public void InitializeWithRequestAndMatcherShouldSetCorrespondingProperty() { var matcher = new TrueRequestSpecification(); var sut = new FreezeOnMatchCustomization(new object(), matcher); Assert.Same(matcher, sut.Matcher); }
public void SutIsRequestSpecification() { // Arrange // Act var sut = new TrueRequestSpecification(); // Assert Assert.IsAssignableFrom <IRequestSpecification>(sut); }
public void InitializeWithTargetTypeAndMatcherShouldSetCorrespondingProperty() { var targetType = typeof(object); var matcher = new TrueRequestSpecification(); var sut = new FreezeOnMatchCustomization(typeof(object), matcher); #pragma warning disable 618 Assert.Equal(targetType, sut.TargetType); #pragma warning restore 618 }
public void SutIsRequestSpecification() { // Fixture setup // Exercise system var sut = new TrueRequestSpecification(); // Verify outcome Assert.IsAssignableFrom <IRequestSpecification>(sut); // Teardown }
public void InitializeWithMatcherShouldSetCorrespondingProperty() { // Arrange var matcher = new TrueRequestSpecification(); // Act var sut = new FreezeOnMatchCustomization(typeof(object), matcher); // Assert Assert.Equal(matcher, sut.Matcher); }
public void CustomSpecificationIsPreserved() { // Arrange var specification = new TrueRequestSpecification(); // Act var sut = new DelegateGenerator(specification); // Assert Assert.Equal(specification, sut.Specification); }
public void CustomSpecificationIsPreserved() { // Arrange var specification = new TrueRequestSpecification(); // Act var sut = new SubstituteRelay(specification); // Assert Assert.Same(specification, sut.Specification); }
public void InitializeWithMatcherShouldSetCorrespondingProperty() { // Fixture setup var matcher = new TrueRequestSpecification(); // Exercise system var sut = new FreezeOnMatchCustomization(typeof(object), matcher); // Verify outcome Assert.Equal(matcher, sut.Matcher); }
public void SpecificationIsCorrect() { // Arrange IRequestSpecification specification = new TrueRequestSpecification(); var sut = new NSubstituteBuilder(Substitute.For <ISpecimenBuilder>(), specification); // Act var result = sut.SubstitutionSpecification; // Assert Assert.Equal(specification, result); }
public void IsSatisfiedByReturnsCorrectResult() { // Arrange var sut = new TrueRequestSpecification(); // Act var dummyRequest = new object(); var result = sut.IsSatisfiedBy(dummyRequest); // Assert Assert.True(result); }
public void NonTypedWithSpecificationReturnsSpecimenTypeIfProvidedInCtor() { // Arrange var type = typeof(string); var spec = new TrueRequestSpecification(); // Act var sut = new AutoPropertiesCommand(type, spec); // Assert Assert.Equal(type, sut.ExplicitSpecimenType); }
public void IsSatisfiedByReturnsCorrectResult() { // Fixture setup var sut = new TrueRequestSpecification(); // Exercise system var dummyRequest = new object(); var result = sut.IsSatisfiedBy(dummyRequest); // Verify outcome Assert.True(result); // Teardown }
public void Create_WithRequestThatIsNotAType_ReturnsNoSpecimen(object request) { // Arrange var specification = new TrueRequestSpecification(); var sut = new NSubstituteBuilder(Substitute.For <ISpecimenBuilder>(), specification); var context = Substitute.For <ISpecimenContext>(); // Act var result = sut.Create(request, context); // Assert var expected = new NoSpecimen(); Assert.Equal(expected, result); }
public void NonTypedWithSpecificationReturnsSpecimenTypeIfProvidedInCtor() { // Fixture setup var type = typeof(string); var spec = new TrueRequestSpecification(); // Exercise system var sut = new AutoPropertiesCommand(type, spec); // Verify outcome Assert.Equal(type, sut.ExplicitSpecimenType); // Teardown }
public void SpecificationIsCorrect() { // Fixture setup IRequestSpecification specification = new TrueRequestSpecification(); var sut = new NSubstituteBuilder(Substitute.For <ISpecimenBuilder>(), specification); // Exercise system var result = sut.SubstitutionSpecification; // Verify outcome Assert.Equal(specification, result); // Teardown }
public void Create_WithRequestThatIsNotAType_ReturnsNoSpecimen(object request) { // Fixture setup var specification = new TrueRequestSpecification(); var sut = new NSubstituteBuilder(Substitute.For <ISpecimenBuilder>(), specification); var context = Substitute.For <ISpecimenContext>(); // Exercise system var result = sut.Create(request, context); // Verify outcome var expected = new NoSpecimen(); Assert.Equal(expected, result); }
public void NonTypedWithSpecificationUsesExplicitlySpecifiedTypeForFieldsAndPropertiesResolve() { // Arrange var trueSpec = new TrueRequestSpecification(); var sut = new AutoPropertiesCommand(typeof(object), trueSpec); var dummyPropertyValue = new object(); var context = new DelegatingSpecimenContext { OnResolve = r => dummyPropertyValue }; var specimen = new PropertyHolder <object>(); // Act sut.Execute(specimen, context); // Assert Assert.NotEqual(dummyPropertyValue, specimen.Property); }
public void NonTypedWithSpecificationUsesExplicitlySpecifiedTypeForFieldsAndPropertiesResolve() { // Fixture setup var trueSpec = new TrueRequestSpecification(); var sut = new AutoPropertiesCommand(typeof(object), trueSpec); var dummyPropertyValue = new object(); var context = new DelegatingSpecimenContext { OnResolve = r => dummyPropertyValue }; var specimen = new PropertyHolder <object>(); // Exercise system sut.Execute(specimen, context); // Verify outcome Assert.NotEqual(dummyPropertyValue, specimen.Property); // Teardown }