Example #1
0
        public void Arrange_returns_result_of_applying_mutation_to_parent_Arrange()
        {
            // Arrange
            var parentArrangement = new ClassToTest(4);
            var theParent = new DummyTestComposite<ClassToTest>();
            theParent.StubbedArrange = () => parentArrangement;
            var theMutation = new DummyMutation<ClassToTest>();
            ClassToTest itemPassedToMutationApply = null;
            theMutation.StubbedApply = d => itemPassedToMutationApply = d;
            var sut = MakeSut(theParent, theMutation);

            // Act
            var actual = sut.Arrange();

            // Assert
            Assert.Same(parentArrangement, actual);
            Assert.Same(parentArrangement, itemPassedToMutationApply);
        }
        public void Composite_with_ConditionToTest_returns_a_TestComposite_with_Arrange_from_parent_Arrange_AND_its_own()
        {
            // Arrange
            var sut = MakeSut();
            var arrangeReturn = new ClassToTest(5);
            var parent = new DummyTestComposite<ClassToTest>();
            parent.StubbedArrange = () => arrangeReturn;
            var mutationNewIntProperty = 666;
            var mutation = new DummyMutation<ClassToTest>();
            mutation.StubbedApply = c => c.IntProperty = mutationNewIntProperty;
            var composite = sut.Composite(parent, mutation);

            // Act
            var actual = composite.Arrange();

            // Assert
            Assert.Same(arrangeReturn, actual);
            Assert.Equal(actual.IntProperty, mutationNewIntProperty);
        }
Example #3
0
        public void Description_returns_Parent_descriptions_AND_mutation_Description()
        {
            // Arrange
            var mutationDescription = "la super description";
            var theMutation = new DummyMutation<ClassToTest>(mutationDescription);
            var parentDescription = "parent description";
            var theParent = new DummyTestComposite<ClassToTest>(parentDescription);
            var sut = MakeSut(theParent, theMutation);
            var expectedDescription = parentDescription + " AND " + mutationDescription;

            // Act
            var actual = sut.Description;

            // Assert
            Assert.Equal(expectedDescription, actual);
        }