Пример #1
0
        public async Task ValidationManagerBase_CheckValid_Returns_Expected_Error()
        {
            var testContext       = new TestContext(new TestEntity(), new TestEntity());
            var instanceUnderTest = new TestValidationManager();
            var actual            = await instanceUnderTest.CheckValid <TestRule1>(testContext);

            var actualRule1Result = actual.First().MemberNames.First();

            Assert.AreEqual(Rule1PropertyText, actualRule1Result);
        }
Пример #2
0
        public async Task ValidationManagerBase_Does_Not_Order_Rules()
        {
            var testContext       = new TestContext(new TestEntity(), new TestEntity());
            var instanceUnderTest = new TestValidationManager(true);
            var results           = await instanceUnderTest.CheckValid(testContext);

            var actualRule2Result = results[0].MemberNames.First();
            var actualRule1Result = results[1].MemberNames.First();

            Assert.AreEqual(Rule1PropertyText, actualRule1Result);
            Assert.AreEqual(Rule2PropertyText, actualRule2Result);
        }
Пример #3
0
 public async Task ValidationManagerBase_CheckValid_Throws_ArgumentOutOfRange_Exception_If_Rule_Not_Found()
 {
     var testContext       = new TestContext(new TestEntity(), new TestEntity());
     var instanceUnderTest = new TestValidationManager();
     await instanceUnderTest.CheckValid <TestNotRegisteredRule>(testContext);
 }