public void AddParametrsTest() { // Arrange var shareRepositoryMock = Substitute.For <ISharesRepository>(); var sut = new ShareManager(shareRepositoryMock); string shareType = "Weyland-Yutani"; decimal sharePrice = (decimal)642134; // Act sut.AddShare(shareType, sharePrice); // Asserts shareRepositoryMock.Received(1).Insert(Arg.Is <Share>(s => s.ShareType == shareType && s.Price == sharePrice)); }
public void AddTest() { // Arrange var shareRepositoryMock = Substitute.For <ISharesRepository>(); var sut = new ShareManager(shareRepositoryMock); Share share = new Share { ShareType = "Umbrella", Price = (decimal)6021023 }; // Act sut.AddShare(share); // Asserts shareRepositoryMock.Received(1).Insert(Arg.Is <Share>(share)); }