コード例 #1
0
ファイル: Class1.cs プロジェクト: shayaneumar/gabbar
        static int Main()
        {
            ITypedSessionManagement target = null;
            P2000LoginReply p2000LoginReply = null;

            try
            {
                target = new SessionManagementService(Config.PegasysUrl);
                p2000LoginReply = target.P2000Login(Config.ValidSuperUserName, Config.ValidSuperUserPassword);

                TestRtl(p2000LoginReply.SessionInfo);
//                TestAlarmGetListEx(p2000LoginReply.SessionInfo);
            }
            catch(Exception e)
            {
                Console.WriteLine("EXCEPTION: " + e.Message);
            }

            if (target != null && p2000LoginReply != null)
            {
                target.P2000Logout(Config.ValidSuperUserName, p2000LoginReply.SessionInfo.SessionGuid);
            }

            Console.WriteLine("Press any key to continue...");
            Console.ReadLine();

            return 0;
        }
コード例 #2
0
        [Ignore] // TODO: Move integration tests into a different project
        public void LogOnTest()
        {
            // Arrange
            ITypedSessionManagement target = new SessionManagementService(_config.PegasysUrl);

            // Act
            var p2000Reply = target.P2000Login(_config.ValidSuperUserName, _config.ValidSuperUserPassword);

            // Assert - nothing to do, just checking to make sure no exception thrown

            // Cleanup the Session
            target.P2000Logout(_config.ValidSuperUserName, p2000Reply.SessionInfo.SessionGuid);
        }
コード例 #3
0
        [TestCategory("IntegrationTest")] // TODO: Move integration tests into a different project
        public void Login_VerifyP2000ReplyTest()
        {
            // Arrange
            ITypedSessionManagement target = new SessionManagementService(_config.PegasysUrl);

            // Act
            var p2000Reply = target.P2000Login(_config.ValidSuperUserName, _config.ValidSuperUserPassword);

            // Assert
            Assert.IsTrue(p2000Reply.UserDetails.Partitions.Length > 0);

            // Cleanup the Session
            target.P2000Logout(_config.ValidSuperUserName, p2000Reply.SessionInfo.SessionGuid);
        }
コード例 #4
0
            public void UsernameNull_ArgumentExceptionIsThrown()
            {
                // Arrange
                var hbService = new SessionManagementService(_config.PegasysUrl);

                // Act + Assert
                ActionAssert.Throws<ArgumentException>(() => hbService.P2000SessionHeartbeat(null, "notwhitespace"), "userName");
            }
コード例 #5
0
            public void InvalidUserInvalidSession_ThrowsException()
            {
                // Arrange
                var hbService = new SessionManagementService(_config.PegasysUrl);

                // Act + Assert
                ActionAssert.Throws<ServiceOperationException>(() => hbService.P2000SessionHeartbeat("not_a_real_user", "not_a_real_sessionid"));
            }
コード例 #6
0
            public void SessionGuidWhitespace_ArgumentExceptionIsThrown()
            {
                // Arrange
                var hbService = new SessionManagementService(_config.PegasysUrl);

                // Act + Assert
                ActionAssert.Throws<ArgumentException>(() => hbService.P2000SessionHeartbeat("userName", "  "), "sessionGuid");
            }