Exemplo n.º 1
0
        public void ResolveResultSingle_fails(IEnumerable <Char> chars)
        {
            var result = new ResolveResultSingle <Char>()
            {
                Results = chars
            };

            Assert.Throws <InvalidOperationException>(() => result.Value);
        }
Exemplo n.º 2
0
        public void ResolveResultSingle_returns_single_result()
        {
            var result = new ResolveResultSingle <Int32>()
            {
                Results = Enumerable.Repeat(42, 1)
            };

            Assert.Equal(42, result.Value);
        }
Exemplo n.º 3
0
        public void ResolveResultSingle_throws_on_failures()
        {
            var expected = new ResolveFailure(Mock.Of <IResolveBuilder>(), "4242");

            var result = new ResolveResultSingle <Int32>()
            {
                Results         = new[] { 42 },
                ResolveFailures = new[]
                {
                    expected
                }
            };

            var exc = Assert.Throws <ResolveFailedException>(() => result.Value);
            var rf  = Assert.Single(exc.Failures);

            Assert.Same(expected, rf);
        }
Exemplo n.º 4
0
        public void ResolveResultSingle_throws_on_failures()
        {
            var expected = new ResolveFailure(Mock.Of<IResolveBuilder>(), "4242");

            var result = new ResolveResultSingle<Int32>()
            {
                Results = new[] { 42 },
                ResolveFailures = new[]
                {
                     expected
                }
            };

            var exc = Assert.Throws<ResolveFailedException>(() => result.Value);
            var rf = Assert.Single(exc.Failures);
            Assert.Same(expected, rf);
        }
Exemplo n.º 5
0
 public void ResolveResultSingle_fails(IEnumerable<Char> chars)
 {
     var result = new ResolveResultSingle<Char>() { Results = chars };
     Assert.Throws<InvalidOperationException>(() => result.Value);
 }
Exemplo n.º 6
0
 public void ResolveResultSingle_returns_single_result()
 {
     var result = new ResolveResultSingle<Int32>() { Results = Enumerable.Repeat(42, 1) };
     Assert.Equal(42, result.Value);
 }