public async Task ShouldReturnFailedResult_Because_DictionaryValueIsNotInteger() { var command = new TeacherScheduleCommand(GetNarfuApi()); var message = GenerateMessageWithPayload(DefaultUser.Id, DefaultUser.Id, command.Trigger, "asd"); var result = await command.Execute(message, DefaultUser); result.Should().BeOfType <FailedResult>(); result.Message.Should().NotBeNullOrEmpty(); }
public async Task ShouldReturnFailedResult_Because_SiteIsUnavailable() { var command = new TeacherScheduleCommand(GetNarfuApiWithHttpException()); var message = GenerateMessageWithPayload(DefaultUser.Id, DefaultUser.Id, command.Trigger, "12345"); var result = await command.Execute(message, DefaultUser); result.Should().BeOfType <FailedResult>(); result.Message.Should().NotBeNullOrEmpty(); }
public async Task ShouldReturnFailedResult_Because_DictionaryKeyIsIncorrect() { var command = new TeacherScheduleCommand(GetNarfuApi()); var message = GenerateMessageWithPayload(DefaultUser.Id, DefaultUser.Id, "key", "12345"); var result = await command.Execute(message, DefaultUser); result.Should().BeOfType <FailedResult>(); result.Message.Should().NotBeNullOrEmpty(); }
public async Task ShouldReturnSuccessfulResult() { var command = new TeacherScheduleCommand(GetNarfuApi()); var message = GenerateMessageWithPayload(DefaultUser.Id, DefaultUser.Id, command.Trigger, "12345"); var result = await command.Execute(message, DefaultUser); result.Should().BeOfType <SuccessfulResult>(); result.Message.Should().NotBeNullOrEmpty(); }