【发布时间】:2016-09-01 08:38:02
【问题描述】:
我正在尝试编写一个 TestNG 来测试属性的数据库更新。伪代码如下。
@Parameters({"newValue"})
@Test
public void testUpdateValue(@Optional String newValue)
{
String originalValue = getValueFromDataBase(); //get Original value
updateValue(newValue); //update property to newValue
String updatedValue = getValueFromDataBase(); //get updated value from db
Assert.assertEquals(updatedValue == newValue, true); //test value updated correctly.
updateValue(originalValue); // reset to origal value after test
}
我是否使用正确的方法来测试数据库更新? 或者 testNG 中还有其他解决方案吗?
提前致谢。
【问题讨论】:
标签: testng