public void ChangeBugInvalidParameters_Should()
        {
            string bugName = "BugNameShould";

            List <string> parameters = new List <string>
            {
                bugName
            };

            ChangeBugStatusCommand command = new ChangeBugStatusCommand(parameters);

            command.Execute();
        }
        public void ThrowExeptionWhenCommandParametersAreLessThanItShould()
        {
            string        bugName        = "BugNameShould";
            string        description    = "MegaBadBug";
            List <string> stepsToProduce = new List <string> {
                "steps"
            };
            var bug = new Bug(bugName, description, stepsToProduce);

            database.Bugs.Add(bug);

            List <string> parameters = new List <string>
            {
                bugName
            };

            ChangeBugStatusCommand command = new ChangeBugStatusCommand(parameters);

            command.Execute();
        }
        public void InputBugStatusParameterIsNULL_Should()
        {
            string        bugName        = "BugNameShould";
            string        description    = "MegaBadBug";
            List <string> stepsToProduce = new List <string> {
                "steps"
            };
            var bug = new Bug(bugName, description, stepsToProduce);

            database.Bugs.Add(bug);

            string newStatus = null;

            List <string> parameters = new List <string>
            {
                bugName,
                newStatus
            };

            ChangeBugStatusCommand command = new ChangeBugStatusCommand(parameters);

            command.Execute();
        }
        public void ValidChangeBugStatus_Should()
        {
            string        bugName        = "BugNameShould";
            string        description    = "MegaBadBug";
            List <string> stepsToProduce = new List <string> {
                "steps"
            };
            var bug = new Bug(bugName, description, stepsToProduce);

            database.Bugs.Add(bug);

            BugStatus bugStatus = BugStatus.Fixed;

            List <string> parameters = new List <string>
            {
                bugName,
                bugStatus.ToString()
            };

            ChangeBugStatusCommand command = new ChangeBugStatusCommand(parameters);

            command.Execute();
            Assert.IsTrue(bug.BugStatus.Equals(bugStatus));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> ChangeStatus(ChangeBugStatusCommand command, CancellationToken token)
        {
            var result = await Mediator.Send(command, token);

            return(Ok(result));
        }