public async Task WithPairingServiceNoSelectOptions() { var dataController = new DataControllerBuilder() .WithPairingService(new PairingServiceBuilder().WithNoSelectOptions().Build()) .Build(); var result = await dataController.Currencies(); result.Should().NotBeNull(ResultEmptyList); }
public async Task WithPairingServiceNoPairings() { var dataController = new DataControllerBuilder() .WithPairingService(new PairingServiceBuilder().WithNoPairings().Build()) .Build(); var result = await dataController.Pairing(1, 1); result.Should().NotBeNull(ResultEmptyList); }
public void WithNullPairingService() { var dataController = new DataControllerBuilder() .WithPairingService(null) .Build(); IEnumerable <SelectOption> result = null; Func <Task> pairing = async() => result = await dataController.Currencies(); pairing.Should().NotThrow <NullReferenceException>("because it should return default empty currencies."); result.Should().NotBeNull(ResultEmptyList) .And.BeEmpty(ResultEmptyList); }
public async Task WithPairingServiceSelectOptions() { var selectOptions = new List <SelectOption>(); selectOptions.Add(new SelectOption()); var dataController = new DataControllerBuilder() .WithPairingService(new PairingServiceBuilder() .WithSelectOptions(selectOptions) .Build()) .Build(); var result = await dataController.Currencies(); result.Should().NotBeNull(ResultEmptyList); result.Should().BeEquivalentTo(selectOptions, "because the PairingService returns the injected data."); }
public async Task WithPairingServicePairings() { var pairings = new List <Pairing>(); pairings.Add(new Pairing()); var dataController = new DataControllerBuilder() .WithPairingService(new PairingServiceBuilder() .WithPairings(pairings) .Build()) .Build(); var result = await dataController.Pairing(1, 1); result.Should().NotBeNull(ResultEmptyList); result.Should().BeEquivalentTo(pairings, "because the PairingService returns the injected data."); }