Ejemplo n.º 1
0
 public CodetableControllerInfo(string name, string route)
 {
     ArgumentValidator.AssertNotNullOrWhiteSpace(name, nameof(name));
     ArgumentValidator.AssertNotNullOrWhiteSpace(route, nameof(route));
     this.Name  = name;
     this.Route = route;
 }
        private void WhiteSpaceRaisesArgumentException()
        {
            var spaces = "    ";
            var ex     = Assert.Throws <ArgumentException>(() => ArgumentValidator.AssertNotNullOrWhiteSpace(spaces, nameof(spaces)));

            Assert.Equal(nameof(spaces), ex.ParamName);
        }
        private void EmptyStringRaisesArgumentException()
        {
            var emptyString = "";
            var ex          = Assert.Throws <ArgumentException>(() => ArgumentValidator.AssertNotNullOrWhiteSpace(emptyString, nameof(emptyString)));

            Assert.Equal(nameof(emptyString), ex.ParamName);
        }
        private void NullStringRaisesArgumentNullException()
        {
            string nullString = null;
            var    ex         = Assert.Throws <ArgumentNullException>(() => ArgumentValidator.AssertNotNullOrWhiteSpace(nullString, nameof(nullString)));

            Assert.Equal(nameof(nullString), ex.ParamName);
        }
        private void SentenceDoesNotRaiseException()
        {
            var sentence = "My name is Bond, James Bond.";

            ArgumentValidator.AssertNotNullOrWhiteSpace(sentence, nameof(sentence));
        }
        private void WordDoesNotRaiseException()
        {
            var word = "pigs";

            ArgumentValidator.AssertNotNullOrWhiteSpace(word, nameof(word));
        }
Ejemplo n.º 7
0
        public ISoundEffect CreateSoundEffect(string filePath)
        {
            ArgumentValidator.AssertNotNullOrWhiteSpace(filePath, "filePath");

            return(new SoundEffectAdapter(filePath));
        }
Ejemplo n.º 8
0
 public CodetableControllerAttribute(string name)
 {
     ArgumentValidator.AssertNotNullOrWhiteSpace(name, nameof(name));
     this.Name = name;
 }