public void ShouldCreateNewSharesNumber() { // Arrange SalesService salesService = new SalesService( this.operationTableRepository, this.balanceTableRepository, this.blockedMoneyTableRepository, this.sharesNumberTableRepository, this.blockedSharesNumberTableRepository, this.shareTableRepository); SharesNumberRegistrationInfo args = new SharesNumberRegistrationInfo(); args.Client = new ClientEntity() { Id = 5, CreatedAt = DateTime.Now, FirstName = "John", LastName = "Snickers", PhoneNumber = "+7956244636652", Status = true }; args.Share = new ShareEntity() { Id = 2, CreatedAt = DateTime.Now, CompanyName = "Simple Company", Type = new ShareTypeEntity() { Id = 4, Name = "not so cheap", Cost = 1200.00M, Status = true }, Status = true }; args.Number = 20; // Act var shareId = salesService.CreateSharesNumber(args); // Assert sharesNumberTableRepository.Received(1).Add(Arg.Is <SharesNumberEntity>( n => n.Client == args.Client && n.Share == args.Share && n.Number == args.Number)); sharesNumberTableRepository.Received(1).SaveChanges(); }