Example #1
0
		public void GetCustomerBets_WhenRepositoryDataIsNull_ReturnNull()
		{
			// Arrange
			var stubUnsettledRepository = MockRepository.GenerateStub<IUnsettledRepository>();
			stubUnsettledRepository.Stub(x => x.GetData("")).Return(null);

			// Act
			var sut = new UnsettledBetService(stubUnsettledRepository, null);
			var result = sut.GetCustomerBets();

			//Assert
			Assert.IsNull(result);
		}
Example #2
0
		public void GetCustomerBets_WhenRepositoryDataIsNotNull_ReturnList()
		{
			// Arrange
			var stubData = new List<IUnsettledBet>
			{
				new UnsettledBet()
			};
			var stubUnsettledRepository = MockRepository.GenerateStub<IUnsettledRepository>();
			stubUnsettledRepository.Stub(x => x.GetData("")).IgnoreArguments().Return(stubData);

			// Act
			var sut = new UnsettledBetService(stubUnsettledRepository, null);
			var result = sut.GetCustomerBets();

			//Assert
			Assert.IsNotNull(result);
		}