Ejemplo n.º 1
0
        public void Effort_ServerStore_AddToServerAsync_Test()
        {
            // Task AddToServerAsync(ApplicationUser user, string serverName)
            // Add a new test server
            _dbContext.Servers.Add(testServer);
            _dbContext.SaveChanges();
            // Get user
            ApplicationUser _user          = _dbContext.Users.FirstOrDefault(u => u.UserName == "Phil");
            int             _expectedCount = _user.Servers.Count + 1;

            // end of setup
            Task.Run(async() =>
            {
                await _sut.AddToServerAsync(_user, testServerName);
                Assert.AreEqual(_expectedCount, _user.Servers.Count);
            }).GetAwaiter().GetResult();
        }