public void Setup() { _unitOfWorkFactory = new FakeUnitOfWorkFactory(); IUserRepository userRepository = new FakeUserRepository(_unitOfWorkFactory); IMembershipRepository membershipRepository = new FakeMembershipRepository(_unitOfWorkFactory); IRoleRepository roleRepository = new FakeRoleRepository(_unitOfWorkFactory); _roleProvider = new RoleProvider(roleRepository, _unitOfWorkFactory); _userRegistrationService = new UserRegistrationService(userRepository, membershipRepository, _unitOfWorkFactory); CreateTestData(); }
private void AddRoles() { string[] h = { "Id", "Name" }; IRoleRepository repo = new FakeRoleRepository(); Database["SqlServer"].ExecuteNonQuery(@"PRINT 'here'"); var list = repo.Get(); Database["SqlServer"].ExecuteNonQuery(@"PRINT 'here2'"); foreach (Role i in list) { Database.Insert("Role", h, new string[] { i.Id.ToString(), i.Name.ToString() }); } }