public void CustomizeNullFixtureThrows()
 {
     // Fixture setup
     var sut = new AutoRhinoMockCustomization();
     // Exercise system and verify outcome
     Assert.Throws<ArgumentNullException>(() =>
         sut.Customize(null));
     // Teardown
 }
        public void CustomizeNullFixtureThrows()
        {
            // Arrange
            var sut = new AutoRhinoMockCustomization();

            // Act & Assert
            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.Customize(null));
        }
Пример #3
0
        public void CustomizeNullFixtureThrows()
        {
            // Fixture setup
            var sut = new AutoRhinoMockCustomization();

            // Exercise system and verify outcome
            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.Customize(null));
            // Teardown
        }
        public void CustomizeAddsAppropriateResidueCollectors()
        {
            // Fixture setup
            var residueCollectors = new List<ISpecimenBuilder>();
            var fixtureStub = MockRepository.GenerateMock<IFixture>();
            fixtureStub.Stub(c => c.ResidueCollectors).Return(residueCollectors);

            var sut = new AutoRhinoMockCustomization();
            // Exercise system
            sut.Customize(fixtureStub);
            // Verify outcome
            var postprocessor = residueCollectors.OfType<RhinoMockAroundAdvice>().Single();
            var ctorInvoker = Assert.IsAssignableFrom<MethodInvoker>(postprocessor.Builder);
            Assert.IsAssignableFrom<RhinoMockConstructorQuery>(ctorInvoker.Query);
            // Teardown
        }
        public void CustomizeAddsAppropriateResidueCollectors()
        {
            // Arrange
            var residueCollectors = new List <ISpecimenBuilder>();
            var fixtureStub       = MockRepository.GenerateMock <IFixture>();

            fixtureStub.Stub(c => c.ResidueCollectors).Return(residueCollectors);

            var sut = new AutoRhinoMockCustomization();

            // Act
            sut.Customize(fixtureStub);
            // Assert
            var postprocessor = residueCollectors.OfType <RhinoMockAroundAdvice>().Single();
            var ctorInvoker   = Assert.IsAssignableFrom <MethodInvoker>(postprocessor.Builder);

            Assert.IsAssignableFrom <RhinoMockConstructorQuery>(ctorInvoker.Query);
        }