コード例 #1
0
        public void Given_NullServiceOptions_InvokeAsync_ShouldThrow_Exception()
        {
            var service = new AglPayloadProcessingService();

            Func <Task> func = async() => await service.InvokeAsync <ServiceOptionsBase>(null).ConfigureAwait(false);

            func.ShouldThrow <ArgumentNullException>();
        }
コード例 #2
0
        public async void Given_Payload_InvokeAsync_ShouldReturn_Result(PetType petType)
        {
            var service = new AglPayloadProcessingService();

            var people = this._fixture.ArrangePeople();
            var count  = people.Count(p => p.Pets.Any(q => q.PetType == petType));

            var options = new AglPayloadProcessingServiceOptions()
            {
                People = people, PetType = petType
            };

            await service.InvokeAsync(options).ConfigureAwait(false);

            options.Groups.Should().HaveCount(count);
            options.IsInvoked.Should().BeTrue();
        }