public void Get_NoBallotFound_ThrowsException()
        {
            // Arrange
            int expectedBallotnumber = 123456;

            using (var context = new BitLotteryContext(Options))
            {
                BallotRepository ballotRepository = new BallotRepository(context);

                try
                {
                    // Act
                    ballotRepository.Get(expectedBallotnumber);
                }
                catch (Exception exception)
                {
                    // Assert
                    exception.Message.Should().Be("BallotId: 123456 not found");
                    throw;
                }
            }
        }
Beispiel #2
0
 public override void Setup()
 {
     base.Setup();
     ballotRepository = new BallotRepository(null, new BallotService());
 }