Exemple #1
0
        public async Task ShouldCallTheApiIfSearchTermIsNotNull()
        {
            //Given
            var sut         = new EventRepo(_mockApiProvider.Object);
            var searchTerms = "stereophonics";

            //When
            await sut.GetEventDetails(searchTerms);

            //Then
            _mockApiProvider.Verify(m => m.GetViagogoApiClient(), Times.Once);
        }
Exemple #2
0
        public async Task ShouldNotCallTheApiIfNullIsPassed()
        {
            //Given
            var searchTerms = default(string);
            var sut         = new EventRepo(_mockApiProvider.Object);

            //When
            await sut.GetEventDetails(searchTerms);

            //Then
            _mockApiProvider.Verify(m => m.GetViagogoApiClient(), Times.Never);
        }
Exemple #3
0
        public async Task ShouldReturnNullIfNoResultsFromApiCall()
        {
            //Given
            var searchTerms = $"no-results-{Guid.NewGuid()}";

            var sut = new EventRepo(_mockApiProvider.Object);

            //When
            var results = await sut.GetEventDetails(searchTerms);

            //Then
            results.Should().BeNull();
        }