示例#1
0
        private static Result <IContainer> BuildDependencies(Options options)
        {
            var colors = ColorsParser.ParseColors(options.Colors);

            if (!colors.IsSuccess)
            {
                return(Result.Fail <IContainer>(colors.Error));
            }
            return(BuildDependencies(options.Width, options.Height, colors.Value, options.Input));
        }
示例#2
0
 public void ParseCorrectColors()
 {
     ColorsParser.ParseColors("rgbp").GetValueOrThrow().Should()
     .BeEquivalentTo(new[] { Color.Red, Color.Green, Color.Blue, Color.Purple });
 }
示例#3
0
 public void ReturnError_WhenColorsAreNotCorrect()
 {
     ColorsParser.ParseColors("rfdagad").IsSuccess.Should().BeFalse();
 }
示例#4
0
文件: Program.cs 项目: CakeOrRiot/di
 private static IContainer BuildDependencies(Options options)
 {
     return(BuildDependencies(options.Width, options.Height,
                              ColorsParser.ParseColors(options.Colors),
                              options.Input));
 }