<分区> 分区>
我在代码文件的开头使用静态变量,因为我稍后会用它来验证值:
static string fullNameValue = UniqueIdGenerator.GenerateUniqueId(Convert.ToInt32(Data["FirstName"] ));
public void FillName() {
Pages.SitecoreCMS.Field_Company.Text = fullNameValue;
}
// break.............
public void VerifyingFullName() {
Assert.IsTrue(ArtOfTest.Common.CompareUtils.StringCompare(Pages.Contact.FrameContentIFrame.SitecoreTentativeaccountnameText.Text,fullNameValue, ArtOfTest.Common.StringCompareType.Contains));
}
编译失败:非静态字段、方法或属性“ArtOfTest.WebAii.Design.BaseWebAiiTest.Data.get”需要对象引用
我应该如何更改此代码? 我以前使用过非静态变量,但我无法通过其他方法(例如 VerifyingFullName)使用它。
