public async Task GetTestScenariosBySpecificationId_WhenSpeficationIdIsEmpty_ShouldThrowException() { // Arrange IScenariosApiClient scenariosApiClient = Substitute.For <IScenariosApiClient>(); ICacheProvider cacheProvider = CreateCacheProvider(); ScenariosRepository scenariosRepository = new ScenariosRepository(scenariosApiClient, cacheProvider, CreateMapper()); ArgumentNullException exception = null; // Act try { IEnumerable <TestScenario> configuredTaskAwaiter = await scenariosRepository.GetTestScenariosBySpecificationId(string.Empty); } catch (Exception e) { exception = e as ArgumentNullException; } // Assert exception.Should().NotBeNull(); exception.Should().BeOfType <ArgumentNullException>(); await scenariosApiClient.DidNotReceive().GetTestScenariosBySpecificationId(Arg.Any <string>()); }