Beispiel #1
0
        public void Mash_Steps_Valid_NonEmpty()
        {
            Mash_Steps mash_Steps = new Mash_Steps();

            Mock <Mash_Step> mash_Step = GetMockMash_Step();

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

            mash_Steps.Add(mash_Step.Object);

            ValidationCode errorCode = ValidationCode.SUCCESS;

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

            Mock <Mash_Step> mash_Step = GetMockMash_Step();

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

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