public async Task Put_University()
        {
            University test_university = new University()
            {
                Id     = "1002",
                Name   = "UIC",
                Domain = "chicago.illinois.edu"
            };

            var result = await _controller.PutUniversity("1002", test_university);

            Assert.IsType <NoContentResult>(result);

            var modified_result = await _controller.GetUniversity("1002");

            Assert.Equal("chicago.illinois.edu", modified_result.Value.Domain);
        }
Esempio n. 2
0
        public async Task Put_University_Success()
        {
            var uni = new University
            {
                Name   = "UIUC",
                Domain = "illinois.edu"
            };

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

            uni.Name   = "Stanford";
            uni.Domain = "stanford.edu";

            var result = await _controller.PutUniversity(uni.Id, uni);

            Assert.IsType <NoContentResult>(result);

            Assert.Equal(uni, _context.Universities.Find(uni.Id));
        }