Exemplo n.º 1
0
        public void ValidateFailEmptyNameTest()
        {
            string name    = string.Empty;
            string command = "namesay";

            {
                CowFileInfo uut = new CowFileInfo();
                uut.CommandList[command] = name;
                Assert.Throws <ValidationException>(() => uut.Validate());
            }

            name = null;

            {
                CowFileInfo uut = new CowFileInfo();
                uut.CommandList[command] = name;
                Assert.Throws <ValidationException>(() => uut.Validate());
            }

            name = "     ";
            {
                CowFileInfo uut = new CowFileInfo();
                uut.CommandList[command] = name;
                Assert.Throws <ValidationException>(() => uut.Validate());
            }
        }
Exemplo n.º 2
0
        public void ValidateSuccessTest()
        {
            string name    = "name";
            string command = "namesay";

            CowFileInfo uut = new CowFileInfo();

            uut.CommandList[command] = name;
            Assert.DoesNotThrow(() => uut.Validate());

            Assert.AreEqual(name, uut.CommandList[command]);
        }
Exemplo n.º 3
0
        public void ValidateFailEmptyCommandTest()
        {
            string name    = "name";
            string command = string.Empty;

            {
                CowFileInfo uut = new CowFileInfo();
                uut.CommandList[command] = name;
                Assert.Throws <InvalidOperationException>(() => uut.Validate());
            }

            command = "     ";
            {
                CowFileInfo uut = new CowFileInfo();
                uut.CommandList[command] = name;
                Assert.Throws <InvalidOperationException>(() => uut.Validate());
            }
        }
Exemplo n.º 4
0
        public void ValidateFailEmptyList()
        {
            CowFileInfo uut = new CowFileInfo();

            Assert.Throws <ValidationException>(() => uut.Validate());
        }