public void HandleParcel(Parcel parcel) { IParcelHandler handler = new InsuranceHandler(); handler.SetNext(new PackagingHandler()); handler.Handle(parcel); }
public void Handle_ShouldAskForApproval_IfNotAskedBeforeAndValueOver1000() { // Arrange Parcel parcel = new Parcel(); parcel.Value = 1000; // Act var attempt = _sut.Handle(parcel); // Assert attempt.Success.Should().BeFalse(); attempt.Result.RequiresApproval.Should().BeTrue(); attempt.Result.Parcel.Should().BeSameAs(parcel); attempt.Exception.Should().BeNull(); }