public void ShouldCreateNewBlockedSharesNumberItem() { // Arrange SalesService salesService = new SalesService( this.operationTableRepository, this.balanceTableRepository, this.blockedMoneyTableRepository, this.sharesNumberTableRepository, this.blockedSharesNumberTableRepository); BlockedSharesNumberRegistrationInfo args = new BlockedSharesNumberRegistrationInfo(); var tempShare = 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.ClientSharesNumber = new SharesNumberEntity() { Id = 30, Client = new ClientEntity() { Id = 5, CreatedAt = DateTime.Now, FirstName = "John", LastName = "Snickers", PhoneNumber = "+7956244636652", Status = true }, Share = tempShare, Number = 7 }; args.Operation = new OperationEntity() { Id = 2 }; args.Number = 5; // Act var blockedSharesNumberId = salesService.CreateBlockedSharesNumber(args); // Assert blockedSharesNumberTableRepository.Received(1).Add(Arg.Is <BlockedSharesNumberEntity>( bn => bn.ClientSharesNumber == args.ClientSharesNumber && bn.Operation == args.Operation && bn.Seller == args.ClientSharesNumber.Client && bn.Share == tempShare && bn.ShareTypeName == tempShare.Type.Name && bn.Cost == tempShare.Type.Cost && bn.Number == args.Number)); blockedSharesNumberTableRepository.Received(1).SaveChanges(); }