public void Create_thread_fail() { //Arrange AddThreadCommand command = null; //Act - Assert Assert.Throws <ArgumentNullException>(() => OrderThread.CreateNew(command)); }
public void Finish_order_fail() { //Arrange var order = Order.CreateNew(new AddOrderCommand { State = OrderState.Waiting }); AddThreadCommand command = null; //Act - Assert Assert.Throws <ArgumentNullException>(() => order.Finish(OrderThread.CreateNew(command))); }
public void Update_thread_interval_should_has_positive_value() { //Arrange var thread = OrderThread.CreateNew(new AddThreadCommand { State = OrderThreadState.Stopped }); int interval = -100; //Act - Assert Assert.Throws <ArgumentException>(() => thread.UpdateInterval(interval)); }
public void Create_thread_success() { //Arrange var command = new AddThreadCommand { State = OrderThreadState.Stopped }; //Act var thread = OrderThread.CreateNew(command); //Assert Assert.NotNull(thread); }
public void Update_thread_interval_success() { //Arrange var thread = OrderThread.CreateNew(new AddThreadCommand { State = OrderThreadState.Stopped }); int interval = 100; //Act thread.UpdateInterval(interval); //Assert Assert.NotNull(thread); }
public void Finish_order_success() { //Arrange var order = Order.CreateNew(new AddOrderCommand { State = OrderState.Waiting }); //Act order.Finish(OrderThread.CreateNew(new AddThreadCommand { State = OrderThreadState.Stopped })); //Assert Assert.NotNull(order); }
private OrderThread FakeThread() { return(OrderThread.CreateNew(FakeCommand())); }