Exemplo n.º 1
0
 private bool IsNullInArgPlaceholder(ArgPlaceholder argPlaceholder)
 {
     return(argPlaceholder.Name == null ||
            argPlaceholder.Placeholder == null ||
            argPlaceholder.Parameters == null ||
            (argPlaceholder.Parameters.Count > 0 && argPlaceholder.Parameters.Values.Any(p => p is null)));
 }
Exemplo n.º 2
0
            public void Should_Translate_WithNameArg(string path, ArgPlaceholder placeholder, string message, string expectedTranslatedMessage)
            {
                var indexedPathsPlaceholders = new Dictionary <int, IReadOnlyList <ArgPlaceholder> >()
                {
                    [0] = new[]
                    {
                        placeholder
                    }
                };

                var results = MessageTranslator.TranslateMessagesWithPathPlaceholders(path, new[] { message }, indexedPathsPlaceholders);

                results.Count.Should().Be(1);

                results[0].Should().Be(expectedTranslatedMessage);
            }