Beispiel #1
0
        public async Task Delete_University_Success()
        {
            var uni = new University
            {
                Name   = "UIUC",
                Domain = "illinois.edu"
            };

            _context.Universities.Add(uni);
            _context.SaveChanges();

            var result = await _controller.DeleteUniversity(uni.Id);

            Assert.Equal(uni, result.Value);
            Assert.Empty(_context.Universities.ToList());
        }
        public async Task Delete_University()
        {
            University test_university = new University()
            {
                Id     = "1002",
                Name   = "UIC",
                Domain = "chicago.illinois.edu"
            };

            var result = await _controller.DeleteUniversity(test_university.Id);

            var return_university = Assert.IsType <University>(result.Value);

            Assert.Equal(test_university.Id, return_university.Id);
            Assert.Equal(test_university.Name, return_university.Name);
            Assert.Equal(test_university.Domain, return_university.Domain);
        }