Exemple #1
0
        public void Mashs_Valid_NonEmpty()
        {
            Mashs mashs = new Mashs();

            Mock <Mash> mash = GetMockMash();

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

            mashs.Add(mash.Object);

            ValidationCode errorCode = ValidationCode.SUCCESS;

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

            Mock <Mash> mash = GetMockMash();

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

            mashs.Add(mash.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(mashs.IsValidRecordSet(ref errorCode, suppressTypeCheck: false));
        }