public void GetTransactionTypeByCode_Should_Throw_WhenGiven_Invalid_Params() { const string invalidCode = null; _transTypeConfiguration.SetupMockEntityRepositoryForGetAll(_transTypeList); var transService = new TransactionService(_transTypeConfiguration.MockPersistence.Object, _transTypeConfiguration.MockLog.Object, _transTypeConfiguration.MockSecurity.Object); transService.GetTransactionTypeByCode(invalidCode); }
public void GetTransactionTypeByCode_Should_Return_Null_WhenGiven_NotExistsCode() { const string exceptedcode = "NotExistsCode"; _transTypeConfiguration.SetupMockEntityRepositoryForGetAll(_transTypeList); var transService = new TransactionService(_transTypeConfiguration.MockPersistence.Object, _transTypeConfiguration.MockLog.Object, _transTypeConfiguration.MockSecurity.Object); var returnValue = transService.GetTransactionTypeByCode(exceptedcode); _transTypeConfiguration.MockEntity.VerifyAll(); Assert.IsNull(returnValue); }
public void GetTransactionTypeByCode_Should_Return_Valid_Data() { const string exceptedCode = "PAY"; const int actualValue = 1; _transTypeConfiguration.SetupMockEntityRepositoryForGetAll(_transTypeList); var transService = new TransactionService(_transTypeConfiguration.MockPersistence.Object, _transTypeConfiguration.MockLog.Object, _transTypeConfiguration.MockSecurity.Object); var returnValue = transService.GetTransactionTypeByCode(exceptedCode); _transTypeConfiguration.MockEntity.VerifyAll(); Assert.IsNotNull(returnValue); Assert.AreEqual(returnValue.LicenceID, actualValue); }