Пример #1
0
        public void TestInit()
        {
            // Arrange
            Mock<IUserRepository> userRepository = new Mock<IUserRepository>();
            User user = new User
            {
                Email = "test",
                Password = "******"
            };

            userRepository.Setup(x => x
                                          .GetByEmail("test"))
                .Returns(user);

            userRepository.Setup(x => x
                                          .AreMatchingPasswords(It.IsAny<string>(), It.IsAny<string>()))
                .Returns((string l, string r) => l == r);

            miniMembership = MockHelpers.FakeMiniMembership(userRepository.Object);
        }
Пример #2
0
 public static MiniMembershipProvider FakeMiniMembership(IUserRepository userRepository = null)
 {
     MiniMembershipProvider miniMembership = new MiniMembershipProvider(userRepository);
     return miniMembership;
 }