Ejemplo n.º 1
0
        public DigestAuthenticatorTest()
        {
            Fake.InitializeFixture(this);

            //configuration.Authenticator = new AuthenticationInspectingAuthenticator(configuration);
            //configuration.PrincipalBuilder = principalBuilder;
            var fakeMembershipProvider = A.Fake <MembershipProvider>();
            var fakeUser = A.Fake <MembershipUser>();

            A.CallTo(() => fakeUser.GetPassword()).Returns("Circle Of Life");
            A.CallTo(() => fakeMembershipProvider.Name).Returns("Fake");
            A.CallTo(() => fakeMembershipProvider.GetUser("Mufasa", A <Boolean> .Ignored)).Returns(fakeUser);
            Membership.Providers.AddMembershipProvider(fakeMembershipProvider);

            //for our tests, we're just going to wire up this one hardcoded principalBuilder
            MockPrincipalBuilderFactory.Builder = A.Fake <IPrincipalBuilder>();

            A.CallTo(() => MockPrincipalBuilderFactory.Builder.ConstructPrincipal(A <HttpContextBase> .Ignored, A <MembershipUser> .Ignored, A <NetworkCredential> .Ignored))
            .ReturnsLazily(call => new GenericPrincipal(new GenericIdentity(call.GetArgument <string>("userName")), new[] { "roles" }));

            privateHashEncoder = new PrivateHashEncoder("MyPrivateKey");

            Opaque.Current = () => "5ccc069c403ebaf9f0171e9517f40e41";
        }
Ejemplo n.º 2
0
 public NonceManagerTest()
 {
     privateHashEncoder = new PrivateHashEncoder(key);
 }
Ejemplo n.º 3
0
 public PrivateHashEncoderTest()
 {
     standardEncoder = new PrivateHashEncoder(privateKey);
 }
Ejemplo n.º 4
0
 public DigestFailureHandlerTest()
 {
     privateHashEncoder = new PrivateHashEncoder(secretKey);
 }
Ejemplo n.º 5
0
 public PrivateHashEncoderTest()
 {
     standardEncoder = new PrivateHashEncoder(privateKey);
 }
Ejemplo n.º 6
0
 public DigestFailureHandlerTest()
 {
     privateHashEncoder = new PrivateHashEncoder(secretKey);
 }
Ejemplo n.º 7
0
 public NonceManagerTest()
 {
     privateHashEncoder = new PrivateHashEncoder(key);
 }