/// <summary> /// Initializes a new instance of the <see cref="GuardClauseAssertion" /> class. /// </summary> /// <param name="builder"> /// A composer which can create instances required to implement the idiomatic unit test. /// </param> /// <param name="behaviorExpectation"> /// A behavior expectation to override the default expectation. /// </param> /// <remarks> /// <para> /// <paramref name="builder" /> will typically be a <see cref="Fixture" /> instance. /// </para> /// </remarks> public GuardClauseAssertion(ISpecimenBuilder builder, IBehaviorExpectation behaviorExpectation) { this.Builder = builder; this.BehaviorExpectation = behaviorExpectation; this.openGenericTypeClosingUtil = new OpenGenericTypeClosingUtil(builder); }
public SkipSpecifiedParametersBehaviorExpectation( IBehaviorExpectation innerBehaviorExpectation, params string[] parameterNames) { _filter = new FilteredParametersBehaviorExpectation(parameterNames); InnerBehaviorExpectation = innerBehaviorExpectation; }
public void BehaviorExpectationIsCorrectFromGreedyConstructor() { // Arrange var dummyComposer = new Fixture(); IBehaviorExpectation expected = new DelegatingBehaviorExpectation(); var sut = new GuardClauseAssertion(dummyComposer, expected); // Act IBehaviorExpectation result = sut.BehaviorExpectation; // Assert Assert.Equal(expected, result); }
public void BehaviorExpectationIsCorrectFromGreedyConstructor() { // Fixture setup var dummyComposer = new Fixture(); IBehaviorExpectation expected = new DelegatingBehaviorExpectation(); var sut = new GuardClauseAssertion(dummyComposer, expected); // Exercise system IBehaviorExpectation result = sut.BehaviorExpectation; // Verify outcome Assert.Equal(expected, result); // Teardown }
/// <summary> /// Initializes a new instance of the <see cref="GuardClauseAssertion" /> class. /// </summary> /// <param name="builder"> /// A composer which can create instances required to implement the idiomatic unit test. /// </param> /// <param name="behaviorExpectation"> /// A behavior expectation to override the default expectation. /// </param> /// <remarks> /// <para> /// <paramref name="builder" /> will typically be a <see cref="Fixture" /> instance. /// </para> /// </remarks> public GuardClauseAssertion(ISpecimenBuilder builder, IBehaviorExpectation behaviorExpectation) { this.builder = builder; this.behaviorExpectation = behaviorExpectation; }
public DeferredBehaviourExpectation() { nullAndEmptyGuidBehaviorExpectation = new CompositeBehaviorExpectation(new NullReferenceBehaviorExpectation(), new EmptyGuidBehaviorExpectation()); }
/// <summary> /// Initializes a new instance of the <see cref="GuardClauseAssertion"/> class. /// </summary> /// <param name="builder"> /// A composer which can create instances required to implement the idiomatic unit test. /// </param> /// <param name="behaviorExpectation"> /// A behavior expectation to override the default expectation. /// </param> /// <remarks> /// <para> /// <paramref name="builder" /> will typically be a <see cref="Fixture" /> instance. /// </para> /// </remarks> public GuardClauseAssertion(ISpecimenBuilder builder, IBehaviorExpectation behaviorExpectation) { this.builder = builder; this.behaviorExpectation = behaviorExpectation; }