示例#1
0
        public void RoadQueryFeatures(string roadName, RoadCorridor roadCorridor, ApiError apiError)
        {
            $"Road service should not be null"
            .x(() => _roadService.Should().NotBeNull());
            $"And it should be query the road {roadName}"
            .x(async() => { (roadCorridor, apiError) = await _roadService.Get(roadName); });

            $"Than the road {roadName} query should return an api error DTO"
            .x(() => apiError.Should().NotBeNull());

            $"And road query result should be in type ApiError DTO"
            .x(() => apiError.Should().BeOfType(typeof(ApiError)));

            $"And api error result should be equal HTTP status code 404"
            .x(() => apiError.HttpStatusCode.Should().Be(404));

            $"Also api error result string should be contains 'is not a valid road' message and queried road name"
            .x(() => apiError.ToString().Should().ContainAll(new string[] { roadName, "is not a valid road" }));
        }
        public void RoadQueryFeatures(string roadName, RoadCorridor roadCorridor, ApiError apiError)
        {
            $"Road service should not be null"
            .x(() => _roadService.Should().NotBeNull());

            $"And it should be query the road {roadName}"
            .x(async() => { (roadCorridor, apiError) = await _roadService.Get(roadName); });

            $"Than the road {roadName} query should not return an api error DTO"
            .x(() => apiError.Should().BeNull());

            $"And road query result should be in type RoadCorridor DTO"
            .x(() => roadCorridor.Should().BeOfType(typeof(RoadCorridor)));

            $"And road query result should be equal queried road name as well"
            .x(() => roadCorridor.DisplayName.ToLower().Should().BeEquivalentTo(roadName.ToLower()));

            $"Also road query result string should be contains 'Road Status' and 'Road Status Description' texts"
            .x(() => roadCorridor.ToString().Should().ContainAll(new string[] { "Road Status", "Road Status Description" }));
        }