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