Beispiel #1
0
        public void Can_be_projected_onto_results_list()
        {
            var response = AggregatedResponseFactory.CreateFrom(_runners);
            var results  = response.AsResultsList();

            Assert.NotNull(results);
            Assert.Single(results, "42");
        }
        public void Can_be_deconstructed()
        {
            var response = AggregatedResponseFactory.CreateFrom(_runners);

            var(completed, faulted, incomplete) = response;
            Assert.Single(completed);
            Assert.Single(faulted);
            Assert.Single(incomplete);
        }
        public void Can_be_created()
        {
            var response = AggregatedResponseFactory.CreateFrom(_runners);

            Assert.Equal(_runners.Length, response.TotalInvocationsCount);
            Assert.Single(response.Completed);
            Assert.Single(response.Faulted);
            Assert.Single(response.Incomplete);
        }
Beispiel #4
0
        public void Can_be_projected_onto_results_dictionary()
        {
            var response = AggregatedResponseFactory.CreateFrom(_runners);
            var results  = response.AsResultsDictionary();

            Assert.NotNull(results);
            Assert.Single(results.Keys);
            Assert.Equal(typeof(SomeType), results.Keys.First().Type);
            Assert.Single(results.Values);
            Assert.Equal("42", results.Values.First());
        }
        public void Invocations_are_grouped_correctly()
        {
            var response = AggregatedResponseFactory.CreateFrom(_runners);

            Assert.Equal(typeof(SomeType), response.Completed[0].Recipient.Type);
            Assert.Equal("42", response.Completed[0].Result);

            Assert.Equal(typeof(SomeFaultingType), response.Faulted[0].Recipient.Type);
            Assert.Equal("A failure.", response.Faulted[0].Exception?.Message);

            Assert.Equal(typeof(SomeNeverEndingType), response.Incomplete[0].Recipient.Type);
        }