Esempio n. 1
0
        public async Task WithPairingServiceNoSelectOptions()
        {
            var dataController = new DataControllerBuilder()
                                 .WithPairingService(new PairingServiceBuilder().WithNoSelectOptions().Build())
                                 .Build();

            var result = await dataController.Currencies();

            result.Should().NotBeNull(ResultEmptyList);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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.");
        }