示例#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);
        }
示例#2
0
        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);
        }
示例#3
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);
        }
示例#4
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.");
        }
示例#5
0
        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.");
        }