Exemplo n.º 1
0
        public void ForNoKeyInDictionaryTryGetShouldNotReturnValue()
        {
            var errors = new ResultErrorsDictionary();
            var result = errors.TryGetValue("key", out var value);

            new { result, value }.Should().BeEquivalentTo(new { result = false, value = new string[0] });
        }
Exemplo n.º 2
0
        public void ForKeyInDictionaryTryGetShouldReturnValue()
        {
            var errors = new ResultErrorsDictionary {
                { "key", "value" }
            };
            var result = errors.TryGetValue("key", out var value);

            new { result, value }.Should().BeEquivalentTo(new { result = true, value = new List <string> {
                                                                    "value"
                                                                } });
        }