Ejemplo n.º 1
0
            public void AuthenticateTestForValidRequests(AuthenticationTestFixture testCase)
            {
                var escher = new Escher { Config = testCase.config.ToEscherConfig() };

                var apiKey = escher.Authenticate(testCase.request, testCase.KeyDb, testCase.config.DateTime);

                Assert.AreEqual(testCase.expected.apiKey, apiKey);
            }
Ejemplo n.º 2
0
            public void AuthenticateTestForInvalidRequests(AuthenticationTestFixture testCase)
            {
                var escher = new Escher { Config = testCase.config.ToEscherConfig() };

                try
                {
                    escher.Authenticate(testCase.request, testCase.KeyDb, testCase.config.DateTime);

                    Assert.Fail("Authentication should have failed");
                }
                catch (EscherAuthenticationException e)
                {
                    Assert.AreEqual(testCase.expected.error, e.Message);
                }
            }