public void CanInsertValidAvailabilityTest()
        {
            Availability availability = new Availability
            {
                FromDate = DateTime.Now,
                ToDate = DateTime.Now
            };

            context.Entry(availability).State = EntityState.Added;

            Assert.DoesNotThrow(() => context.SaveChanges());
        }
        public void InsertingInvalidAvailabilityThrowsExceptionTest()
        {
            Availability availabilityNullFrom = new Availability
            {
                ToDate = DateTime.Now
            };

            context.Entry(availabilityNullFrom).State = EntityState.Added;

            Assert.Throws<DbEntityValidationException>(() => context.SaveChanges());

            Availability availabilityNullTo = new Availability
            {
                FromDate = DateTime.Now
            };

            context.Entry(availabilityNullFrom).State = EntityState.Detached;
            context.Entry(availabilityNullTo).State = EntityState.Added;

            Assert.Throws<DbEntityValidationException>(() => context.SaveChanges());
        }