Exemplo n.º 1
0
            public void AcceptedTicket_AbleToChangeToClosedOrRejected()
            {
                Ticket newTicket = new Ticket();
                newTicket.Accept();

                Assert.True(newTicket.IsCloseable);
                Assert.True(newTicket.IsRejectable);
            }
Exemplo n.º 2
0
            public void ClosedTicket_CannotChangeStatusAnymore()
            {
                Ticket newTicket = new Ticket();
                newTicket.Accept();
                newTicket.Close();

                Assert.False(newTicket.IsAcceptable);
                Assert.False(newTicket.IsRejectable);
            }
Exemplo n.º 3
0
 public void AcceptedTicket_ableToChangeToClosedOrRejected()
 {
     var t = new Ticket();
     t.Title = "Test Ticket";
     t.Body = "Blah blah";
     t.Accept();
     Assert.False(t.CanChangeTo(TicketStatus.New));
     Assert.False(t.CanChangeTo(TicketStatus.Accepted));
     Assert.True(t.CanChangeTo(TicketStatus.Rejected));
     Assert.True(t.CanChangeTo(TicketStatus.Closed));
 }
Exemplo n.º 4
0
            public void ChangeFromNewToAccepted()
            {
                var t = new Ticket();

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

                t.Accept();

                Assert.True(t.Status == TicketStatus.Accepted);
                Assert.Equal(2, t.TicketStates.Count());
            }
Exemplo n.º 5
0
 public void ClosedTicket_CannotChangeStatusAnymore()
 {
     var t = new Ticket();
     t.Title = "Test Ticket";
     t.Body = "Blah blah";
     t.Accept();
     t.Close();
     Assert.False(t.CanChangeTo(TicketStatus.New));
     Assert.True(t.CanChangeTo(TicketStatus.Accepted));
     Assert.False(t.CanChangeTo(TicketStatus.Rejected));
     Assert.False(t.CanChangeTo(TicketStatus.Closed));
 }
Exemplo n.º 6
0
            public void AcceptedTicket_AbleToChangeToClosedOrRejected()
            {
                using (var app = new App(testing: true))
                {
                    var t = new Ticket();
                    app.Tickets.Add(t);

                    t.Accept();

                    Assert.False(t.IsAcceptable);
                    Assert.True(t.IsRejectable);
                    Assert.True(t.IsCloseable);
                }
            }
Exemplo n.º 7
0
            public void ChangeFromNewToAccepted()
            {
                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.Accept();

                    Assert.True(t.Status == TicketStatus.Accepted);
                    Assert.Equal(2, t.TicketStates.Count());
                }
            }
Exemplo n.º 8
0
            public void ClosedTicket_CannotChangeStatusAnymore()
            {
                using (var app = new App(testing: true))
                {
                    var t = new Ticket();
                    app.Tickets.Add(t);
                    t.Accept();
                    t.Close();

                    Assert.False(t.IsAcceptable);
                    Assert.False(t.IsRejectable);
                    Assert.False(t.IsCloseable);
                }
            }