예제 #1
0
        public async Task CreateUserAsyncTest()
        {
            //Setup DbContext mock
            var _context = await GetDatabaseContext();

            var _users = new UsersProvider(_context);

            //Assert
            try
            {
                await _users.CreateUserAsync(new Users
                {
                    FirstName = "Test",
                    LastName  = "User2",
                    Age       = 27,
                    Address   = "United Kingdom",
                    Interests = "Asp.net core and C# Programming"
                });
            }
            catch (Exception ex)
            {
                throw new Exception("Cannot add a new record.");
            }
        }