Example #1
0
        public void GetPhrase_PhraseNotPresent_ReturnsPhraseKey()
        {
            // arrange
            var sut = new PhraseDictionary();

            // act
            var result = sut.GetPhrase("invalid phrase", "en");

            // assert
            Assert.Equal("invalid phrase", result);
        }
Example #2
0
        public void GetPhrase_PhraseKeyIsNull_ThrowsException()
        {
            // arrange
            var    sut       = new PhraseDictionary();
            Action sutAction = () => sut.GetPhrase(null, "en");

            // act, assert
            var ex = Assert.Throws <ArgumentNullException>(sutAction);

            Assert.Equal("phraseKey", ex.ParamName);
        }
Example #3
0
        public void GetPhrase_PhraseKeyIsValid_ReturnsPhrase(string key, string expected)
        {
            // arrange
            var sut = new PhraseDictionary();

            // act
            var result = sut.GetPhrase(key, "en");

            // assert
            Assert.Equal(expected, result);
        }