public void TwoSamePinsAreTheSameValues() { var pinValue = "1234"; var pin = Pin.From(pinValue); var samePin = Pin.From(pinValue); pin.Should().Be(samePin); }
public void EqualityOperatorForSameValuesWorksCorrectly() { var pinValue = "1234"; var pin = Pin.From(pinValue); var samePin = Pin.From(pinValue); (pin == samePin).Should().BeTrue(); }
public async Task <IActionResult> Login([FromQuery] string emailAddress) { var pin = Pin.From(emailAddress, config.SecretPinSalt, config.SecretEmailSalt, CurrentTime); await loginService.SendPin(emailAddress, pin); var tempCodeForTesting = pin.GeneratePinCode(emailAddress); return(Ok(tempCodeForTesting)); }
public void EqualityOperatorForOtherValuesWorksCorrectly() { var pinValue = "2222"; var otherPinValue = "1111"; var pin = Pin.From(pinValue); var otherPin = Pin.From(otherPinValue); (pin == otherPin).Should().BeFalse(); }
public WhenRefundWasRequested() { Given(() => _creditCard = new CreditCard(Money.From(50), Pin.From("1234"))); When(() => { Subject.Charge(_creditCard, Pin.From("1234"), Money.From(5)); Subject.Refund(_creditCard, Money.From(5)); }); }
public void TwoDifferentPinsAreDifferentValues() { var pinValue = "2222"; var otherPinValue = "1111"; var pin = Pin.From(pinValue); var otherPin = Pin.From(otherPinValue); pin.Should().NotBe(otherPin); }
public void CardChargeSucceeded() { _creditCard.GetBalance(Pin.From("1234")).Should().Be(Money.From(45)); }
public WhenHadEnoughMoneyOnCard() { Given(() => _creditCard = new CreditCard(Money.From(50), Pin.From("1234"))); When(() => Subject.Charge(_creditCard, Pin.From("1234"), Money.From(5))); }
public void ThenMoneyWasRefunded() { _creditCard.GetBalance(Pin.From("1234")).Should().Be(Money.From(50)); }
public void ThenCreditCardWasCharged() { _creditCard.GetBalance(Pin.From("1234")).Amount.Should().Be(Money.From(45).Amount); }
public WhenWithdrawMoneyFromCard() { Given(() => _creditCard = new CreditCard(Money.From(50), Pin.From("1234"))); When(() => Subject.WithdrawMoney(_creditCard, Money.From(5), Pin.From("1234"))); }