Beispiel #1
0
        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));
        }
Beispiel #2
0
        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));
        }