public void GetInitializedPropertiesTest() { var dObj = new DataObjectForTest { Name = "Вася" }; string[] expected = { Information.ExtractPropertyPath <DataObjectForTest>(x => x.Name), Information.ExtractPropertyPath <DataObjectForTest>(x => x.Height), Information.ExtractPropertyPath <DataObjectForTest>(x => x.BirthDate), Information.ExtractPropertyPath <DataObjectForTest>(x => x.Gender), Information.ExtractPropertyPath <DataObjectForTest>(x => x.__PrimaryKey) }; string[] actual = dObj.GetInitializedProperties(); Assert.True(EquivalenceMethods.EqualStringArrays(expected, actual)); var obj = new ClassWithCaptions(); string[] expected1 = { Information.ExtractPropertyPath <ClassWithCaptions>(x => x.InformationTestClass4), Information.ExtractPropertyPath <ClassWithCaptions>(x => x.__PrimaryKey) }; string[] actual1 = obj.GetInitializedProperties(); Assert.True(EquivalenceMethods.EqualStringArrays(expected1, actual1)); }
public void CheckNotNullPropertiesTest2() { // Входной параметр: новый объект класса MasterClass. var obj = new MasterClass(); string[] actual = obj.CheckNotNullProperties(Information.GetView("MasterClassE", typeof(MasterClass)), false); // Ожидаемый результат: пустой массив строк. Assert.True(EquivalenceMethods.EqualStringArrays(new string[0], actual)); }
public void CheckNotNullPropertiesTest() { // Входной параметр: новый объект класса MasterClass. var obj = new MasterClass(); // Ожидаемый результат: пустой массив строк. var expected = new string[0]; string[] actual = obj.CheckNotNullProperties(); Assert.True(EquivalenceMethods.EqualStringArrays(expected, actual)); obj.SetStatus(ObjectStatus.Deleted); actual = obj.CheckNotNullProperties(); Assert.True(EquivalenceMethods.EqualStringArrays(expected, actual)); }
public void GetInitializedPropertiesWithMasterTest() { // Входной параметр: объект класса DataObjectForTest. var dObj = new DataObjectForTest(); var actual = dObj.GetInitializedProperties(true); // Ожидаемый результат: массив строк {"Name", "Height", "BirthDate", "Gender", "_PrimaryKey"}. var expected = new string[] { "Name", "Height", "BirthDate", "Gender", "__PrimaryKey" }; Assert.True(EquivalenceMethods.EqualStringArrays(actual, expected)); var actual1 = dObj.GetInitializedProperties(false); Assert.True(EquivalenceMethods.EqualStringArrays(actual1, expected)); }