Esempio n. 1
0
        [Ignore] // TODO: Move integration tests into a different project
        public void AlarmGetListTest()
        {
            // Arrange
            var target = new AlarmService(_config.PegasysUrl, _config.RealTimeServiceAddress);

            // Act
            var actual = target.AlarmGetListEx(_config.ValidSuperUserName, _config.SessionGuid, null, null, null, null, null, null, 50, null);

            // Assert
            Assert.IsTrue(actual.AlarmMessages.Length > 0, 
                          "Assertion Failed because Proxy method AlarmGetList Failed to return any alarms."); 
        }
Esempio n. 2
0
        [Ignore] // TODO: Move integration tests into a different project
        public void AlarmActionTest()
        {
            AlarmMessageDetails messageDetails1 = null;
            AlarmMessageDetails messageDetails2 = null;
            // Arrange
            ITypedAlarmService alarmService = new AlarmService(_config.PegasysUrl, _config.RealTimeServiceAddress);


            var alarmResponse = alarmService.AlarmGetListEx(_config.ValidSuperUserName,
                                                            _config.SessionGuid,
                                                            null, null, null, null, null, null, 50, new SortOrder());

            foreach (var message in alarmResponse.AlarmMessages)
            {
                if (message.MessageDetails.AlarmState == "3")
                {
                    if (messageDetails1 == null)
                        messageDetails1 = message.MessageDetails;
                    else if (messageDetails2 == null)
                    {
                        messageDetails2 = message.MessageDetails;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            // Act
            if (messageDetails1 != null && messageDetails2 != null)
                alarmService.AlarmAction(_config.ValidSuperUserName,
                                         _config.SessionGuid.ToString(CultureInfo.InvariantCulture),
                                         new[]
                                             {
                                                 new AlarmIdSequenceTuple(new Guid(messageDetails1.AlarmGuid),
                                                                      Int32.Parse(
                                                                          messageDetails1.ConditionSequenceNumber))
                                                 ,
                                                 new AlarmIdSequenceTuple(new Guid(messageDetails2.AlarmGuid),
                                                                      Int32.Parse(
                                                                          messageDetails2.ConditionSequenceNumber))
                                             }, 3, "Response");

            // Assert
            // Assertion Fails if AlarmUpdate throws an Exception.
        }