Beispiel #1
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);
        }
Beispiel #2
0
        public void WithNullPairingService()
        {
            var dataController = new DataControllerBuilder()
                                 .WithPairingService(null)
                                 .Build();

            IEnumerable <Pairing> result  = null;
            Func <Task>           pairing = async() => result = await dataController.Pairing(1, 1);

            pairing.Should().NotThrow <NullReferenceException>("because it should return default empty Pairing data.");

            result.Should().NotBeNull(ResultEmptyList)
            .And.BeEmpty(ResultEmptyList);
        }
Beispiel #3
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.");
        }