예제 #1
0
        public void Result_Then_Failure_With_Third_Part()
        {
            var result = FullName.Create("Test", "Test").Then(z => AgeGen.Create(32))
                         .Then(z => FullName.Create(null, null));

            Assert.True(result.Failure);
            Assert.Equal("invalid name", result.Error.Message);
        }
예제 #2
0
        public void Result_Combine_Errors()
        {
            var value1 = FullName.Create("test", "gg");
            var value2 = AgeGen.Create(12);
            var value3 = FullName.Create(null, "test");
            var result = Result.Combine(value1, value2, value3);

            Assert.True(result.Failure);
            Assert.Equal("invalid age", result.Error.Message);
        }