Beispiel #1
0
        public void  GetHashCode_WhenCalled_ReturnsHashCodeBasedOnAccountingNumberAndAccountNumber()
        {
            int         accountingNumber    = _fixture.Create <int>();
            IAccounting accounting          = _fixture.BuildAccountingMock(accountingNumber).Object;
            string      accountNumber       = _fixture.Create <string>();
            IAccountBase <IAccountBase> sut = CreateSut(accounting, accountNumber);

            Assert.That(sut.GetHashCode(), Is.EqualTo(string.GetHashCode($"{accountNumber.ToUpper()}@{accountingNumber}")));
        }
Beispiel #2
0
        public void GetHashCode_WhenCalled_AssertNumberWasCalledOnAccounting()
        {
            Mock <IAccounting>          accountingMock = _fixture.BuildAccountingMock();
            IAccountBase <IAccountBase> sut            = CreateSut(accountingMock.Object);

            sut.GetHashCode();

            accountingMock.Verify(m => m.Number, Times.Once);
        }