public void PropertyDependencyAttribute_GetInvalidDependenciesTest() { var invalidDependencies = PropertyDependencyAttribute.GetInvalidDependencies(typeof(TestTypeWithErrors)).ToList(); Assert.AreEqual(1, invalidDependencies.Count); var invalidDependency = invalidDependencies.Single(); Assert.IsTrue(invalidDependency.StartsWith(typeof(TestTypeWithErrors).FullName + ".Property3 ")); Assert.IsTrue(invalidDependency.EndsWith(" Property4")); }
public void PropertyDependencyAttribute_CreateDependencyMappingTest() { var actual = PropertyDependencyAttribute.CreateDependencyMapping(typeof(TestType)); var expectedKeys = GetPropertyNames(1, 2, 3); var actualKeys = actual.Keys.OrderBy(name => name); Assert.IsTrue(expectedKeys.SequenceEqual(actualKeys)); var expectedProperty1Dependencies = GetPropertyNames(2, 3, 4, 5); var actualProperty1Dependencies = actual["Property1"].OrderBy(name => name); Assert.IsTrue(expectedProperty1Dependencies.SequenceEqual(actualProperty1Dependencies)); var expectedProperty2Dependencies = GetPropertyNames(3, 4); var actualProperty2Dependencies = actual["Property2"].OrderBy(name => name); Assert.IsTrue(expectedProperty2Dependencies.SequenceEqual(actualProperty2Dependencies)); var expectedProperty3Dependencies = GetPropertyNames(4); var actualProperty3Dependencies = actual["Property3"].OrderBy(name => name); Assert.IsTrue(expectedProperty3Dependencies.SequenceEqual(actualProperty3Dependencies)); }
public void PropertyDependencyAttribute_ConstructorTest() { var target = new PropertyDependencyAttribute("Test"); }
public void PropertyDependencyAttribute_CreateDependencyMappingThrowsOnInvalidDefinitionTest() { var actual = PropertyDependencyAttribute.CreateDependencyMapping(typeof(TestTypeWithErrors)); }