显示测试中的更改 [英] Show changes in test

查看:48
本文介绍了显示测试中的更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含多个文本字段的网络表单。当用户对其中一个字段进行更改时,要求旧数据和新数据以不同的颜色显示,可能使用富文本框。



我尝试了什么:



我试图谷歌寻求解决方案,并在其他论坛上提出这个问题。

I have a web form with several text fields. When a user makes a change to one of these field, it is requested that the old and new data is shown in a different color, probably using a rich text box.

What I have tried:

I tried to google for a solution, as well as asking this question on other forums.

推荐答案

查看 DiffPlex [ ^ ]。它包含一个示例ASP.NET MVC网站,该网站显示如何以各种格式显示两个字符串之间的差异。
Have a look at DiffPlex[^]. It includes a sample ASP.NET MVC website that shows how to display the differences between two strings in various formats.


在开始担心UI之前,您需要定义和编码以支持这是不同的一点,然后确定你想要如何显示它。

从谷歌开始:之间的区别两个文件c - Google搜索 [ ^ ]并找到有效的东西对你来说 - 这绝不是一件小事 - 然后开始考虑要展示什么以及如何展示。你想显示被删除的东西吗?添加?一个小小的变化?一个很大的变化?这些不是简单的决定,并不容易准确检测。

一旦你确切地确定了你需要显示什么以及你想如何显示它,实际的UI东西是微不足道的:RichTextBox可以使用颜色,下划线,粗体,斜体,......它们是所有以类似的方式指定。谷歌将告诉你如何做到这一点 - 但首先要集中精力识别变化 - 这就困难了!
Before you start worrying about the UI, you need to define and code to support the "this is different bit" and then work out exactly how you want to display it.
Start with Google: difference between two files c - Google Search[^] and find somethign that works for you - this isn't trivial stuff by any means - and then start thinking about what to display and how. Do you want to show stuff that was deleted? Added? A small change? A big change? These aren't simple decisions and they aren't all easy to detect accurately.
The actual UI stuff is trivial once you have decided exactly what you need to display and how you want to display it: a RichTextBox can use colours, underline, bold, italic, ... and they are all specified in similar ways. Google will tell you how to do that - but concentrate on identifying changes first - thats the difficult bit!


这篇关于显示测试中的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆