Ejemplo n.º 1
0
 public void RejectedTicket_CannotChangeStatusAnymore()
 {
     var t = new Ticket();
     t.Title = "Test Ticket";
     t.Body = "Blah blah";
     t.Reject(reason:"Blah hhh");
     Assert.False(t.CanChangeTo(TicketStatus.New));
     Assert.False(t.CanChangeTo(TicketStatus.Accepted));
     Assert.False(t.CanChangeTo(TicketStatus.Rejected));
     Assert.False(t.CanChangeTo(TicketStatus.Closed));
 }
Ejemplo n.º 2
0
            public void ChangeFromNewToRejected()
            {
                var t = new Ticket();

                Assert.True(t.Status == TicketStatus.New);
                Assert.Equal(1, t.TicketStates.Count());

                t.Reject(reason: "test reject");

                Assert.True(t.Status == TicketStatus.Rejected);
                Assert.Equal(2, t.TicketStates.Count());
                var s2 = t.CurrentState as RejectedTicketState;
                Assert.Equal("test reject", s2.Reason);
            }
Ejemplo n.º 3
0
            public void ChangeFromNewToRejected()
            {
                using (var app = new App(testing: true))
                {
                    var t = new Ticket();
                    app.Tickets.Add(t);

                    Assert.True(t.Status == TicketStatus.New);
                    Assert.Equal(1, t.TicketStates.Count());

                    t.Reject(reason: "test reject");

                    Assert.True(t.Status == TicketStatus.Rejected);
                    Assert.Equal(2, t.TicketStates.Count());

                    var s2 = t.CurrentState as RejectedTicketState;
                    Assert.Equal("test reject", s2.Reason);
                }
            }
Ejemplo n.º 4
0
            // 5. RejectedTicket_CannotChangeStatusAnymore
            public void RejectedTicket_CannotChangeStatusAnymore()
            {
                using (var app = new App(testing: true))
                {
                    var t = new Ticket();
                    app.Tickets.Add(t);
                    t.Accept();
                    t.Reject("test reject");

                    Assert.False(t.IsAcceptable);
                    Assert.False(t.IsRejectable);
                    Assert.False(t.IsCloseable);
                }
            }
Ejemplo n.º 5
0
            public void RejectedTicket_CannotChangeStatusAnymore()
            {
                Ticket newTicket = new Ticket();
                newTicket.Reject("test reject");

                Assert.False(newTicket.IsRejectable);
                Assert.False(newTicket.IsCloseable);
            }