Exemple #1
0
        public void GetFestivalFull_FestivalId_ReturnsAFestivalWithAddress()
        {
            //Arrange
            ContextBase.Addresses.AddRange(
                new Address
            {
                Street     = "Test Address",
                Number     = "1",
                PostalCode = "28303",
                State      = "Bremen",
                Country    = "Germany"
            });

            ContextBase.SaveChanges();

            ContextBase.Festivals.AddRange(
                new Festival
            {
                Id          = 14,
                Title       = "Hellfest",
                Description = "",
                StartDate   = DateTimeMock.Object.Now.AddDays(5),
                EndDate     = DateTimeMock.Object.Now.AddDays(8),
                AddressId   = ContextBase.Addresses.First(a => a.Street == "Test Address").Id
            });

            ContextBase.SaveChanges();

            //Act
            Festival festivalFromRepository = MedievalFestivalsRepositoryBase.GetFestivalFull(14);

            //Assert
            Assert.True(festivalFromRepository.Address != null);
        }
Exemple #2
0
        public void GetFestivalFull_NonExistingFestivalId_ResturnsNull()
        {
            //Act
            Festival festivalFromRepository = MedievalFestivalsRepositoryBase.GetFestivalFull(14);

            //Assert
            Assert.True(festivalFromRepository == null);
        }