public void AuthorizeClientToViewOrder(int clientId, OrderApplicationResponseModel order) { if (order.CustomerID != clientId) { throw new ClientOrderAuthorizationException("You have no access to the order."); } }
public void When_Client_Has_No_Authorization_To_View_Order_Raise_Exception() { OrderApplicationResponseModel OrderApplicationResponseData = new OrderApplicationResponseModel { CustomerID = 1 }; Assert.Throws <ClientOrderAuthorizationException>(() => _clientOrderAuthorization.AuthorizeClientToViewOrder(2, OrderApplicationResponseData)); }