示例#1
0
        public async Task CreateNewBCTest()
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(databaseName: "InHarmonyTestLogicDB")
                          .Options;

            using (var context = new ApplicationDbContext(options))
            {
                context.Database.EnsureDeleted();
                context.Database.EnsureCreated();

                Repository         _repository        = new Repository(context, _logger);
                BusinessLogicClass businessLogicClass = new BusinessLogicClass(_repository, _mapperClass, _logger);

                User user = await businessLogicClass.CreatNewBC("username", "password", "email");

                Assert.NotNull(user);
            }
        }
 public async Task <User> CreateUser(User u)
 {
     return(await _businessLogicClass.CreatNewBC(u.UserName, u.Password, u.Email));
 }