public void PaysFees_CallsVehicleFees_WhenCalled() { // Arrange var fees = Substitute.For <IVehicleFees>(); var sut = new TestBaseVehilce(fees, DefaultId, DefaultWeightInKilogram); // Act sut.PaysFee(); // Assert fees.Received().FeeIsPaid(); }
public void ContainsFee_CallsVehicleFees_WhenCalled() { // Arrange var fee = Substitute.For <IFee>(); var fees = Substitute.For <IVehicleFees>(); var sut = new TestBaseVehilce(fees, DefaultId, DefaultWeightInKilogram); // Act sut.ContainsFee(fee); // Assert fees.Received().ContainsFee(fee); }
public void Constructor_SetsWeightInKilogram_WhenCalled() { // Arrange var fees = Substitute.For <IVehicleFees>(); var sut = new TestBaseVehilce(fees, DefaultId, DefaultWeightInKilogram); // Act int actual = sut.WeightInKilogram; // Assert Assert.AreEqual(DefaultWeightInKilogram, actual); }
public void ToString_ReturnsString_WhenCalled() { // Arrange var fees = Substitute.For <IVehicleFees>(); var sut = new TestBaseVehilce(fees, DefaultId, DefaultWeightInKilogram); // Act string actual = sut.ToString(); // Assert Assert.AreEqual("Id: 1 ShortDescription: Fees: 0 IsFeePaid: False", actual); }
public void ShortDescription_ReturnsString_WhenCalled() { // Arrange var fees = Substitute.For <IVehicleFees>(); var sut = new TestBaseVehilce(fees, DefaultId, DefaultWeightInKilogram); // Act string actual = sut.ShortDescription; // Assert Assert.AreEqual(string.Empty, actual); }
public void IsFeePaid_CallsVehicleFees_WhenCalled() { // Arrange var fees = Substitute.For <IVehicleFees>(); fees.IsFeePaid.Returns(true); var sut = new TestBaseVehilce(fees, DefaultId, DefaultWeightInKilogram); // Act bool actual = sut.IsFeePaid; // Assert Assert.True(actual); }
public void Fees_CallsVehicleFees_WhenCalled() { // Arrange var expected = new IFee[0]; var fees = Substitute.For <IVehicleFees>(); fees.Fees.Returns(expected); var sut = new TestBaseVehilce(fees, DefaultId, DefaultWeightInKilogram); // Act IEnumerable <IFee> actual = sut.Fees; // Assert Assert.AreEqual(expected, actual); }