Beispiel #1
0
        public void CreateEducationShouldCreateEducation()
        {
            var options   = new DbContextOptionsBuilder <ApplicationDbContext>().UseInMemoryDatabase("Database_For_CreatingEducations").Options;
            var dbContext = new ApplicationDbContext(options);
            var service   = new EducationService(dbContext);

            var model = new EducationViewModel
            {
                Title                  = "Title",
                AdditionalContent      = "Something",
                AdditionalContentImage = "Something",
                Content                = "Something",
                DownloadLink           = "Something",
                ImageUrl               = "Something",
            };

            var education = service.CreateEducation(model);

            Assert.Equal(1, education);
        }