Пример #1
0
        public void Country_Of_Origin_IsValid()
        {
            var options = new DbContextOptionsBuilder <SBSCDataContext>()
                          .UseInMemoryDatabase(databaseName: "SBSC")
                          .Options;

            var context        = new SBSCDataContext(options);
            var studentService = new StudentService(context);

            SBSCTechnicalAssessmentData.Models.Student studentTest = new SBSCTechnicalAssessmentData.Models.Student()
            {
                Name            = "Test 1",
                Address         = "Address SBSC",
                Age             = 23,
                Approved        = true,
                CountryOfOrigin = "bag",
                EmailAddress    = "*****@*****.**",
                FamilyName      = "Test Family Name SBSC",
            };

            Assert.False(studentService.CreateStudent(studentTest.Name, studentTest.FamilyName, studentTest.Address, studentTest.CountryOfOrigin, studentTest.EmailAddress, studentTest.Age, studentTest.Approved, out string msg));
        }
 public StudentService(SBSCDataContext context)
 {
     _context = context;
 }