Beispiel #1
0
    public async Task ShouldReturnFailedResult_Because_DictionaryKeyDoesNotExists()
    {
        var command = new WeatherDailyCommand(GetWeatherService());
        var message = GenerateMessageWithPayload(DefaultUser.Id, DefaultUser.Id, "asd", "11.11.2011");

        var result = await command.Execute(message, DefaultUser);

        result.Should().BeOfType <FailedResult>();
        result.Message.Should().NotBeNullOrEmpty();
    }
Beispiel #2
0
    public async Task ShouldReturnFailedResult_Because_DictionaryValueIsNotCorrectDate()
    {
        var command = new WeatherDailyCommand(GetWeatherService());
        var message = GenerateMessageWithPayload(DefaultUser.Id, DefaultUser.Id, command.Trigger, "20.20.2020");

        var result = await command.Execute(message, DefaultUser);

        result.Should().BeOfType <FailedResult>();
        result.Message.Should().NotBeNullOrEmpty();
    }
Beispiel #3
0
    public async Task ShouldReturnSuccessfulResult()
    {
        var command = new WeatherDailyCommand(GetWeatherService());
        var message = GenerateMessageWithPayload(DefaultUser.Id, DefaultUser.Id, command.Trigger, "11.11.2011");

        var result = await command.Execute(message, DefaultUser);

        result.Should().BeOfType <SuccessfulResult>();
        result.Message.Should().NotBeNullOrEmpty();
    }
Beispiel #4
0
    public async Task ShouldReturnFailedResult_Because_UserCityIsEmpty()
    {
        DefaultUser.SetCity(string.Empty);
        var command = new WeatherDailyCommand(GetWeatherService());
        var message = GenerateMessageWithPayload(DefaultUser.Id, DefaultUser.Id, command.Trigger, "11.11.2011");

        var result = await command.Execute(message, DefaultUser);

        result.Should().BeOfType <FailedResult>();
        result.Message.Should().NotBeNullOrEmpty();
    }