Example #1
0
        public void IfPersonIsNull()
        {
            string        bugTitle       = "BugTitleShould";
            string        description    = "NeznamKakvoStava";
            List <string> stepsToProduce = new List <string> {
                "one", "two"
            };
            var bug = new Bug(bugTitle, description, stepsToProduce);

            string personName = null;
            var    person     = new Member(personName);

            string typeOfWI = "Bug";

            List <string> parameters = new List <string>
            {
                typeOfWI,
                bugTitle,
                personName
            };

            AssignWorkItemToPersonCommand assign = new AssignWorkItemToPersonCommand(parameters);

            assign.Execute();
        }
Example #2
0
        public void AssignWorkItemToPersonCommand()
        {
            string        bugTitle       = "BugTitleShould";
            string        description    = "NeznamKakvoStava";
            List <string> stepsToProduce = new List <string> {
                "one", "two"
            };
            var bug = new Bug(bugTitle, description, stepsToProduce);

            string personName = "Gosho";
            var    person     = new Member(personName);

            database.Bugs.Add(bug);
            database.Members.Add(person);

            string typeOfWI = "Bug";

            List <string> parameters = new List <string>
            {
                typeOfWI,
                bugTitle,
                personName
            };

            AssignWorkItemToPersonCommand assign = new AssignWorkItemToPersonCommand(parameters);

            assign.Execute();

            var expected = this.database.Members.Any(x => x.WorkItems.Contains(bug));

            Assert.AreEqual(expected, true);
        }
Example #3
0
        public void ThrowExeptionWhenCommandParametersAreMoreThanItShouldCorrectly()
        {
            string        bugTitle       = "BugTitleShould";
            string        description    = "NeznamKakvoStava";
            List <string> stepsToProduce = new List <string> {
                "one", "two"
            };
            var bug = new Bug(bugTitle, description, stepsToProduce);

            string personName = null;
            var    person     = new Member(personName);

            string typeOfWI = "Bug";

            List <string> parameters = new List <string>
            {
                typeOfWI,
                bugTitle,
                personName,
                typeOfWI
            };

            AssignWorkItemToPersonCommand assign = new AssignWorkItemToPersonCommand(parameters);

            assign.Execute();
        }
Example #4
0
        public void IfBugTitleIsNull()
        {
            List <string> parameters = new List <string>
            {
            };

            AssignWorkItemToPersonCommand assign = new AssignWorkItemToPersonCommand(parameters);

            assign.Execute();
        }
        public void ThrowExeptionWhenCommandParametersAreLessThanItShouldCorrectly()
        {
            string bugTitle = "BugTitleShould";
            string typeOfWI = "Bug";

            List <string> parameters = new List <string>
            {
                typeOfWI,
                bugTitle
            };

            AssignWorkItemToPersonCommand assign = new AssignWorkItemToPersonCommand(parameters);

            assign.Execute();
        }
        public void IfPersonIsNull()
        {
            string bugTitle = "BugTitleShould";

            string personName = null;
            var    person     = new Member(personName);

            string typeOfWI = "Bug";

            List <string> parameters = new List <string>
            {
                typeOfWI,
                bugTitle,
                personName
            };

            AssignWorkItemToPersonCommand assign = new AssignWorkItemToPersonCommand(parameters);

            assign.Execute();
        }