public void ShouldAddSharesForClient() { //Arrange ClientsSharesService clientsSharesService = new ClientsSharesService(clientsSharesRepository); ClientsSharesInfo clientsSharesInfo = new ClientsSharesInfo() { ClientID = 1, ShareID = 2, Amount = 20 }; //Act var amount = clientsSharesService.ChangeClientsSharesAmount(clientsSharesInfo); //Assert clientsSharesRepository.Received(1).SaveChanges(); Assert.AreEqual(35, amount); }
public void ShouldRegisterNewSharesForClient() { //Arrange ClientsSharesService clientsSharesService = new ClientsSharesService(clientsSharesRepository); ClientsSharesInfo clientsSharesInfo = new ClientsSharesInfo() { ClientID = 2, ShareID = 1, Amount = 20 }; //Act var amount = clientsSharesService.ChangeClientsSharesAmount(clientsSharesInfo); //Assert clientsSharesRepository.Received(1).Add(Arg.Is <ClientsSharesEntity>( w => w.ClientID == clientsSharesInfo.ClientID && w.ShareID == clientsSharesInfo.ShareID && w.Amount == clientsSharesInfo.Amount)); clientsSharesRepository.Received(1).SaveChanges(); Assert.AreEqual(20, amount); }
public OSharesController(ClientsSharesService shareService) { this.shareService = shareService; }
public DealController(TradingOperationService tradingOperationService, ClientsSharesService clientsSharesService) { this.tradingOperationService = tradingOperationService; this.clientsSharesService = clientsSharesService; }