Beispiel #1
0
        public void Miscs_Valid_NonEmpty()
        {
            Miscs miscs = new Miscs();

            Mock <Misc> misc = GetMockMisc();

            misc.Setup(s => s.IsValid(ref It.Ref <ValidationCode> .IsAny)).Returns(true);

            miscs.Add(misc.Object);

            ValidationCode errorCode = ValidationCode.SUCCESS;

            // need to suppress the type check because moq uses a different type
            Assert.IsTrue(miscs.IsValidRecordSet(ref errorCode, suppressTypeCheck: true));
        }
Beispiel #2
0
        public void Miscs_Invalid_BadType()
        {
            Miscs miscs = new Miscs();

            Mock <Misc> misc = GetMockMisc();

            misc.Setup(s => s.IsValid(ref It.Ref <ValidationCode> .IsAny)).Returns(true);

            miscs.Add(misc.Object);

            ValidationCode errorCode = ValidationCode.SUCCESS;

            // do not suppress type check. Since moq uses a different type anyway,
            // there is no need to test with a different IRecord type
            Assert.IsFalse(miscs.IsValidRecordSet(ref errorCode, suppressTypeCheck: false));
        }