Exemple #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));
        }
Exemple #2
0
 public void ParseCorrectColors()
 {
     ColorsParser.ParseColors("rgbp").GetValueOrThrow().Should()
     .BeEquivalentTo(new[] { Color.Red, Color.Green, Color.Blue, Color.Purple });
 }
Exemple #3
0
 public void ReturnError_WhenColorsAreNotCorrect()
 {
     ColorsParser.ParseColors("rfdagad").IsSuccess.Should().BeFalse();
 }
Exemple #4
0
 private static IContainer BuildDependencies(Options options)
 {
     return(BuildDependencies(options.Width, options.Height,
                              ColorsParser.ParseColors(options.Colors),
                              options.Input));
 }