public async Task When_Notification_Is_Handled_Then_Should_Send_Sms() { const double currentTemp = 1.5; const double coldSpellTemp = 2.0; var enteredAtUtc = new DateTime(2015, 1, 1, 12, 0, 0, DateTimeKind.Utc); var notification = CreateNotification(currentTemp, coldSpellTemp, enteredAtUtc); await Handler.HandleAsync(notification); SmsClient.Received().Send(From, To, "12:00: Entered cold spell. (Temp: 1.5C)."); }
public async Task When_Notification_Is_Handled_Then_Should_Send_Sms_Using_Local_Time() { const double currentTemp = 1.0; const double coldSpellTemp = 2.0; var enteredAtUtc = new DateTime(2015, 6, 1, 11, 0, 0, DateTimeKind.Utc); // 12:00 BST var notification = CreateNotification(currentTemp, coldSpellTemp, enteredAtUtc); await Handler.HandleAsync(notification); SmsClient.Received().Send(Arg.Any <string>(), Arg.Any <string>(), Arg.Is <string>(msg => msg.Contains("12:00:"))); }