Пример #1
0
        public void AnonymousUserEmtpy()
        {
            IHttpContextAccessor httpContextAccessor = new FakeHttpContextAccessor("", "", 0);
            var userInfo = new RhetosAspNetCoreIdentityUser(httpContextAccessor);

            Assert.AreEqual(
                "IsUserRecognized: False" +
                ", UserName: ClientException: This operation is not supported for anonymous user." +
                ", Workstation: " +
                ", Report: <anonymous>,",
                GenerateReport(userInfo));
        }
Пример #2
0
        public void SimpleUser()
        {
            IHttpContextAccessor httpContextAccessor = new FakeHttpContextAccessor("Bob", "1.2.3.4", 123);
            var userInfo = new RhetosAspNetCoreIdentityUser(httpContextAccessor);

            Assert.AreEqual(
                "IsUserRecognized: True" +
                ", UserName: Bob" +
                ", Workstation: 1.2.3.4 port 123" +
                ", Report: Bob,1.2.3.4 port 123",
                GenerateReport(userInfo));
        }