Exemplo n.º 1
0
        public void Matches_OneCaptionContainedInMembers_Validated()
        {
            //Buiding object used during test
            var members = new MemberResult();

            members.Add(new NBi.Core.Analysis.Member.Member("[Hierarchy].[First member]", "First member", 1, 0));

            var subsetOfConstraint = new NBi.NUnit.Member.ContainedInConstraint(new List <string>()
            {
                "First member", "Second Member"
            });

            //Call the method to test
            var res = subsetOfConstraint.Matches(members);

            //Test conclusion
            Assert.That(res, Is.True);
        }
Exemplo n.º 2
0
        public void WriteDescriptionTo_FailureExist_FailureRenderExpectedCalled()
        {
            //Stub the writer
            var stubWriter = new Mock <global::NUnit.Framework.Constraints.MessageWriter>();
            var writer     = stubWriter.Object;

            //Mock the failure
            var mockedFailure = Mock.Of <ItemsMessage>(f => f.RenderExpected() == "failure actual");

            //Buiding object used during test
            var subsetOfConstraint = new NBi.NUnit.Member.ContainedInConstraint(new List <string>()
            {
                "First member"
            });

            subsetOfConstraint.Failure = mockedFailure;

            //Call the method to test
            subsetOfConstraint.WriteDescriptionTo(writer);

            //Test conclusion
            Mock.Get(mockedFailure).Verify(f => f.RenderExpected());
        }