public void RegisterShareTest() { // Arrange var shareRepositoryMock = Substitute.For <ISharesRepository>(); var sut = new SharesService(shareRepositoryMock); ShareRegistrationData share = new ShareRegistrationData { ShareType = "Toyota", SharePrice = (decimal)6021023 }; // Act sut.RegisterShare(share); // Asserts shareRepositoryMock.Received(1).Insert(Arg.Is <Share>(x => x.ShareType == share.ShareType && x.Price == share.SharePrice)); }