Beispiel #1
0
        public void IsThereAuthentication_ReturnsCorrectly(ApiContext context, bool expectedResult)
        {
            var service = new PredefinedJwtAuthenticationService(context, It.IsAny <string>(), It.IsAny <string>());

            var actual = service.IsThereAuthentication();

            Assert.AreEqual(expectedResult, actual);
        }
Beispiel #2
0
        public void Authenticate_DoesNotChangeContext(ApiContext context)
        {
            var sourceContext = TestHelper.CopyObject(context);
            var service       = new PredefinedJwtAuthenticationService(context, It.IsAny <string>(), It.IsAny <string>());

            var updatedContext = service.Authenticate();

            Assert.AreEqual(context, updatedContext);
            AssertExtension.AreObjectsValuesEqual(sourceContext, updatedContext);
        }