public void SetUp()
        {
            theRepository = EntityRepository.InMemory();
            theHash = new PasswordHash();

            theMembership = new MembershipRepository<User>(theRepository, theHash);
        }
 public Coach Get(int id)
 {
     TBL_COACH _coach = new CoachRepository().GetById(id);
     aspnet_Users user = new UsersRepository().GetAll().Where(u => u.UserId == _coach.UserID).SingleOrDefault();
     aspnet_Membership member = new MembershipRepository().GetAll().Where(m => m.UserId == _coach.UserID).SingleOrDefault();
     TBL_REGION _region = new RegionRepository().GetById(_coach.RegionID);
     Coach coach = new Coach();
     coach.UserName = user.UserName;
     coach.RegionName = _region.Name;
     coach.Email = member.Email;
     CoachMappings.ModelToViewModel(coach, _coach);
     return coach;
 }
    private static IList<Member> RetrieveAvailableChairs()
    {
        //var member = new Member();
        //member.Email = "*****@*****.**";
        //member.Phone = "5555555555";
        //member.Name.First = "MyFirst2";
        //member.Name.Last = "LastTest2";
        //member.MembershipId = "Test";
        var repo = new MembershipRepository();
        //repo.Save(member);

        var availableChairs = repo.Members;

        return availableChairs;
    }
Beispiel #4
0
        public static void BeforeMembershipScenarios()
        {
            var context = new ShopAnyWareSql();
            var userRepository = new UserRepository(context);
            var roleRepository = new RoleRepository(context);
            var profileRepository = new ProfileRepository(context);
            var membershipRepository = new MembershipRepository();

            var logger = new FakeLogger();
            var emailService = new FakeEmailService();
            ScenarioContext.Current.Set(emailService);

            var membershipService = new MembershipService(logger, emailService, userRepository, roleRepository, profileRepository, membershipRepository);
            ScenarioContext.Current.Set(membershipService);
        }
        public FranchiseeUser Get(int id, string userId)
        {
            TBL_FRANCHISEE_USERS _franchiseeUSer;
            aspnet_Users user;
            aspnet_Membership member;
            FranchiseeUser franchiseeUser = null;
            try
            {
                _franchiseeUSer = new FranchiseeUsersRepository().GetAll().Where(record => record.FranchiseeID == id && record.UserID == new Guid(userId)).SingleOrDefault();
                user = new UsersRepository().GetAll().Where(u => u.UserId == _franchiseeUSer.UserID).SingleOrDefault();
                member = new MembershipRepository().GetAll().Where(m => m.UserId == _franchiseeUSer.UserID).SingleOrDefault();

                franchiseeUser = new FranchiseeUser();
                franchiseeUser.UserName = user.UserName;
                franchiseeUser.Email = member.Email;
                FranchiseeUserMappings.ModelToViewModel(franchiseeUser, _franchiseeUSer);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return franchiseeUser;
        }
        public void MembershipRepository()
        {
            Mock<IDbSetFactory> factory = new Mock<IDbSetFactory>();
            Mock<DbSet<Membership>> dbSet = new Mock<DbSet<Membership>>();

            factory.Setup(m => m.CreateDbSet<Membership>()).Returns(dbSet.Object);

            MembershipRepository repo = new MembershipRepository(factory.Object);

            var Membership = new Membership();

            var sequence = new MockSequence();
            dbSet.InSequence(sequence).Setup(e => e.Add(Membership));
            dbSet.InSequence(sequence).Setup(e => e.Find(Membership.Id));
            dbSet.InSequence(sequence).Setup(e => e.Find(Membership.Id));
            dbSet.InSequence(sequence).Setup(e => e.Find(Membership.Id));
            repo.Create(Membership);
            repo.Get(Membership.Id);
            repo.Update(Membership);
            repo.Delete(Membership.Id);
        }
Beispiel #7
0
 public static void BeforeExpressCheckoutScenarios()
 {
     var context = new ShopAnyWareSql();
     var userRepository = new UserRepository(context);
     var roleRepository = new RoleRepository(context);
     var profileRepository = new ProfileRepository(context);
     var membershipRepository = new MembershipRepository();
     var transactionRepo = new TransactionsRepository();
     var emailSvc = new FakeEmailService();
     var logger = new FakeLogger();
     var emailService = new FakeEmailService();
     var transactionService = new TransactionService(transactionRepo, emailSvc, logger);
     ScenarioContext.Current.Set(transactionService);
     var membershipService = new MembershipService(logger, emailService, userRepository, roleRepository, profileRepository, membershipRepository);
     ScenarioContext.Current.Set(membershipService);
 }