/// <summary> /// Initializes a new instance of the <see cref="AlarmGetResponseTextListReply"/> class /// with the specified values for the properties. /// </summary> public AlarmGetResponseTextListReply(AlarmResponseTextFilter filter, Paging paging, SortOrder sortOrder, params ResponseText[] responseTexts) { Filter = filter; Paging = paging; SortOrder = sortOrder; ResponseTexts = responseTexts; }
/// <summary> /// Initializes a new instance of the <see cref="AlarmGetResponseTextListRequest"/> class. /// </summary> /// <param name="alarmResponseTextFilter">The alarm response filter object.</param> /// <param name="paging">The paging object</param> /// <param name="sortOrder">The sort order object.</param> public AlarmGetResponseTextListRequest( AlarmResponseTextFilter alarmResponseTextFilter, Paging paging, SortOrder sortOrder) { Filter = alarmResponseTextFilter; Paging = paging; SortOrder = sortOrder; }
public void PageNumberTest() { // Arrange const int expected = 1; // Act var actual = new Paging {PageNumber = 1}; // Assert DtoAssert.AreEqual(expected, actual.PageNumber); }
public void ConstructorAllMembersTest() { // Arrange var expected = new Paging {PageNumber = 5, RecordsPerPage = 50, RecordCount = 500}; // Act var actual = new Paging(5, 50, 500); // Assert DtoAssert.AreEqual(expected, actual); }
public void PagingTest() { // Arrange var expected = new Paging(5, 50, 500); var requestObj = new AlarmGetResponseTextListRequest { Paging = new Paging(5, 50, 500) }; // Act var actual = requestObj.Paging; // Assert DtoAssert.AreEqual(expected, actual); }
public void TotalRecordsRequestTest() { // Arrange var expected = new Paging { RecordsPerPage = Paging.MaxRecordsPerPage, RecordCount = Paging.AllRecordsRecordCount }; // Act Paging actual = Paging.TotalRecordsRequest(); // Assert DtoAssert.AreEqual(expected, actual); }
/// <summary> /// This function is provided clients to obtain a list of the response texts in the P2000 system. For performance reasons /// and to limit the impact of the server, this function supports paging. /// </summary> /// <param name="userName">The P2000 username associated with the specified session GUID</param> /// <param name="sessionGuid">Client’s P2000 session GUID</param> /// <param name="sortOrder">A SortOrder object containing an array of SortKeys, and the sort Order</param> /// <param name="paging">A Paging object containing the number of records per page, and page number being requested</param> /// <returns></returns> /// <exception cref="ArgumentNullException">Thrown if any argument is passed in as null.</exception> /// <exception cref="ServiceOperationException">Thrown if a Fault Code is returned by the RPC Server /// or if there are any <see cref="WebException"/> while trying to contact the XML-RPC Server. /// Captured exceptions will be included as an inner exception.</exception> public AlarmGetResponseTextListReply AlarmGetResponseTextList(string userName, string sessionGuid, SortOrder sortOrder, Paging paging) { if (userName == null) throw new ArgumentNullException("userName"); if (sessionGuid == null) throw new ArgumentNullException("sessionGuid"); // Create default Request object with Paging "Turned off" var alarmRequest = new P2000AlarmGetResponseTextListRequest( new AlarmGetResponseTextListRequest { Filter = new AlarmResponseTextFilter(), Paging = paging, SortOrder = sortOrder }); // Serialize the request object string xmlDoc = XmlSerializer<P2000AlarmGetResponseTextListRequest>.Instance.Serialize(alarmRequest); // Call the P2000, and get back a Serialized response within the returned string var responseStructure = _alarmServiceProxy.Invoke(proxy => proxy.AlarmGetResponseTextList(userName, sessionGuid, xmlDoc)); // Deserialize the response into the P2000AlarmGetResponseTextListReply structure. var responseObj = XmlSerializer<P2000AlarmGetResponseTextListReply>.Instance.Deserialize(responseStructure.XmlDoc); return responseObj.AlarmGetResponseTextListReply; }
public void RecordsPerPageTest() { // Arrange const int expected = 1; // Act var actual = new Paging {RecordsPerPage = 1}; // Assert DtoAssert.AreEqual(expected, actual.RecordsPerPage); }
public void WithEmptyPagingElementPresent() { // Arrange var expected = new Paging(); const string xml = @"<Paging> </Paging>"; // Act var actual = _pagingSerializer.Deserialize(xml); // Assert DtoAssert.AreEqual(expected, actual); }
public void WithRecordCountElementMissing() { // Arrange var expected = new Paging {PageNumber = 4, RecordsPerPage = 50}; const string xml = @"<Paging> <Page>4</Page> <RecordsPerPage>50</RecordsPerPage> </Paging>"; // Act var actual = _pagingSerializer.Deserialize(xml); // Assert DtoAssert.AreEqual(expected, actual); }
public void TotalRecordCountTest() { // Arrange const int expected = 1; // Act var actual = new Paging {RecordCount = 1}; // Assert DtoAssert.AreEqual(expected, actual.RecordCount); }