Exemplo n.º 1
0
        public void GivenIHaveAnExistingReservationWithStatus(string requiredStatus)
        {
            TestData.ReservationId = Guid.NewGuid();

            Enum.TryParse(requiredStatus, true, out ReservationStatus status);

            var dbContext = Services.GetService <ReservationsDataContext>();

            var reservation = new Domain.Entities.Reservation
            {
                AccountId              = 1,
                AccountLegalEntityId   = TestData.AccountLegalEntity.AccountLegalEntityId,
                AccountLegalEntityName = TestData.AccountLegalEntity.AccountLegalEntityName,
                CourseId      = TestData.Course.CourseId,
                CreatedDate   = DateTime.UtcNow,
                ExpiryDate    = DateTime.UtcNow.AddMonths(2),
                IsLevyAccount = false,
                Status        = (short)status,
                StartDate     = DateTime.UtcNow.AddMonths(1),
                Id            = TestData.ReservationId,
                UserId        = TestData.UserId
            };

            dbContext.Reservations.Add(reservation);
            dbContext.SaveChanges();
        }
Exemplo n.º 2
0
        public void GivenIHaveAnExistingReservationWithStatusBeforeReservationResetDate()
        {
            TestData.ReservationId = Guid.NewGuid();

            var dbContext = Services.GetService <ReservationsDataContext>();

            var reservation = new Domain.Entities.Reservation
            {
                AccountId              = 1,
                AccountLegalEntityId   = TestData.AccountLegalEntity.AccountLegalEntityId,
                AccountLegalEntityName = TestData.AccountLegalEntity.AccountLegalEntityName,
                CourseId      = TestData.Course.CourseId,
                CreatedDate   = DateTime.UtcNow.AddMonths(-1),
                ExpiryDate    = DateTime.UtcNow.AddMonths(2),
                IsLevyAccount = false,
                Status        = (short)ReservationStatus.Completed,
                StartDate     = DateTime.UtcNow.AddMonths(1),
                Id            = TestData.ReservationId,
                UserId        = TestData.UserId
            };

            dbContext.Reservations.Add(reservation);
            dbContext.SaveChanges();
        }