public async Task AddRaffleEntry_ToNotRunningRaffle_WithValidEntry_ReturnNull() { // arrange _currentRaffle = new Raffle { State = RaffleState.NotRunning }; _currentRaffleEntry = new RaffleEntry(); var svc = new RaffleService(_updaterMock.Object, _prizeServiceMock.Object, _configMock.Object, _loggerMock.Object) { LatestRaffle = _currentRaffle }; // act var result = await svc.AddRaffleEntry(_currentRaffleEntry); // assert // TODO: Update ASSERT for Adding a Raffle Entry to a Not Running Assert.IsNotNull(result); }
public async Task AddRaffleEntry_ToRunningRaffle_WithValidEntry_ReturnsValidId() { // arrange _currentRaffle.State = RaffleState.Running; _updaterMock .Setup(updater => updater.UpdateRaffle(It.IsAny <Raffle>())) .Returns(async() => await Task.CompletedTask); var svc = new RaffleService(_updaterMock.Object, _prizeServiceMock.Object, _configMock.Object, _loggerMock.Object) { LatestRaffle = _currentRaffle }; // act await svc.AddRaffleEntry(_currentRaffleEntry); // assert Assert.IsTrue(_currentRaffle.Entries.Count == 1); Assert.AreEqual(_currentRaffle.Entries[0], _currentRaffleEntry); }