Ejemplo n.º 1
0
        public void GetConstraint_ReferenceExistsXml_ReferenceExistsConstraint()
        {
            var sutXmlStub = new Mock <Systems.ResultSetSystemXml>();

            sutXmlStub.Setup(s => s.File).Returns("myChild.csv");
            var sutXml = sutXmlStub.Object;

            var ctrXml        = new ReferenceExistsXml();
            var parentXmlStub = new Mock <Systems.ResultSetSystemXml>();

            parentXmlStub.Setup(s => s.File).Returns("myParent.csv");
            ctrXml.ResultSet = parentXmlStub.Object;

            var builder = new ResultSetReferenceExistsBuilder();

            builder.Setup(sutXml, ctrXml, null, null, new ServiceLocator());
            builder.Build();
            var ctr = builder.GetConstraint();

            Assert.That(ctr, Is.InstanceOf <ReferenceExistsConstraint>());
        }
Ejemplo n.º 2
0
        public void GetSystemUnderTest_ResultSetSystemXml_IResultSetService()
        {
            var sutXmlStub = new Mock <Systems.ResultSetSystemXml>();

            sutXmlStub.Setup(s => s.File).Returns("myFile.csv");
            var sutXml = sutXmlStub.Object;

            var ctrXml        = new ReferenceExistsXml();
            var parentXmlStub = new Mock <Systems.ResultSetSystemXml>();

            parentXmlStub.Setup(s => s.File).Returns("myParent.csv");
            ctrXml.ResultSet = parentXmlStub.Object;

            var builder = new ResultSetReferenceExistsBuilder();

            builder.Setup(sutXml, ctrXml, null, null, new ServiceLocator());
            builder.Build();
            var sut = builder.GetSystemUnderTest();

            Assert.That(sut, Is.Not.Null);
            Assert.That(sut, Is.InstanceOf <IResultSetService>());
        }