public void CreateWithNullContainerWillThrow()
 {
     // Fixture setup
     var sut = new ValueIgnoringSeedUnwrapper();
     // Exercise system
     var dummyRequest = new object();
     sut.Create(dummyRequest, null);
     // Verify outcome (expected exception)
     // Teardown
 }
 public void CreateWithNullRequestWillReturnNull()
 {
     // Fixture setup
     var sut = new ValueIgnoringSeedUnwrapper();
     // Exercise system
     var dummyContainer = new DelegatingSpecimenContainer();
     var result = sut.Create(null, dummyContainer);
     // Verify outcome
     Assert.IsNull(result, "Create");
     // Teardown
 }
        public void CreateWithNullContainerWillThrow()
        {
            // Fixture setup
            var sut = new ValueIgnoringSeedUnwrapper();
            // Exercise system
            var dummyRequest = new object();

            sut.Create(dummyRequest, null);
            // Verify outcome (expected exception)
            // Teardown
        }
 public void CreateFromSeedWhenContainerCannotSatisfyWrappedRequestWillReturnNull()
 {
     // Fixture setup
     var anonymousSeed = new SeededRequest(typeof(object), new object());
     var unableContainer = new DelegatingSpecimenContainer { OnCreate = r => null };
     var sut = new ValueIgnoringSeedUnwrapper();
     // Exercise system
     var result = sut.Create(anonymousSeed, unableContainer);
     // Verify outcome
     Assert.IsNull(result, "Create");
     // Teardown
 }
        public void CreateWithNullRequestWillReturnNull()
        {
            // Fixture setup
            var sut = new ValueIgnoringSeedUnwrapper();
            // Exercise system
            var dummyContainer = new DelegatingSpecimenContainer();
            var result         = sut.Create(null, dummyContainer);

            // Verify outcome
            Assert.IsNull(result, "Create");
            // Teardown
        }
        public void CreateFromSeedWhenContainerCanSatisfyWrappedRequestWillReturnCorrectResult()
        {
            // Fixture setup
            var anonymousSeed = new SeededRequest(typeof(object), new object());

            var expectedResult = new object();
            var container = new DelegatingSpecimenContainer { OnCreate = r => expectedResult };

            var sut = new ValueIgnoringSeedUnwrapper();
            // Exercise system
            var result = sut.Create(anonymousSeed, container);
            // Verify outcome
            Assert.AreEqual(expectedResult, result, "Create");
            // Teardown
        }
        public void CreateFromSeedWhenContainerCannotSatisfyWrappedRequestWillReturnNull()
        {
            // Fixture setup
            var anonymousSeed   = new SeededRequest(typeof(object), new object());
            var unableContainer = new DelegatingSpecimenContainer {
                OnCreate = r => null
            };
            var sut = new ValueIgnoringSeedUnwrapper();
            // Exercise system
            var result = sut.Create(anonymousSeed, unableContainer);

            // Verify outcome
            Assert.IsNull(result, "Create");
            // Teardown
        }
        public void CreateFromSeedWhenContainerCanSatisfyWrappedRequestWillReturnCorrectResult()
        {
            // Fixture setup
            var anonymousSeed = new SeededRequest(typeof(object), new object());

            var expectedResult = new object();
            var container      = new DelegatingSpecimenContainer {
                OnCreate = r => expectedResult
            };

            var sut = new ValueIgnoringSeedUnwrapper();
            // Exercise system
            var result = sut.Create(anonymousSeed, container);

            // Verify outcome
            Assert.AreEqual(expectedResult, result, "Create");
            // Teardown
        }
        public void CreateFromSeedWillCorrectlyInvokeContainer()
        {
            // Fixture setup
            var sut           = new ValueIgnoringSeedUnwrapper();
            var seededRequest = new SeededRequest(typeof(int), 1);

            var mockVerified  = false;
            var containerMock = new DelegatingSpecimenContainer();

            containerMock.OnCreate = r =>
            {
                Assert.AreEqual(typeof(int), r, "Create");
                mockVerified = true;
                return(null);
            };
            // Exercise system
            sut.Create(seededRequest, containerMock);
            // Verify outcome
            Assert.IsTrue(mockVerified, "Mock verification");
            // Teardown
        }
        public void CreateFromSeedWillCorrectlyInvokeContainer()
        {
            // Fixture setup
            var sut = new ValueIgnoringSeedUnwrapper();
            var seededRequest = new SeededRequest(typeof(int), 1);

            var mockVerified = false;
            var containerMock = new DelegatingSpecimenContainer();
            containerMock.OnCreate = r =>
            {
                Assert.AreEqual(typeof(int), r, "Create");
                mockVerified = true;
                return null;
            };
            // Exercise system
            sut.Create(seededRequest, containerMock);
            // Verify outcome
            Assert.IsTrue(mockVerified, "Mock verification");
            // Teardown
        }