public async Task GetDoorbotsHistory_Verify() { // ARRANGE // Mock the HttpWebRequest and HttpWebResponse (which is within the request)- AUTH var mockHttpWebRequestAuth = CreateMockHttpWebRequest(HttpStatusCode.NotModified, "A-OK", ExpectedAuthenticationResponseBytes); // Mock the HttpWebRequest and HttpWebResponse (which is within the request)- Devices var mockHttpWebRequestDoorbotHistory = CreateMockHttpWebRequest(HttpStatusCode.NotModified, "A-OK", ExpectedDoorbotsHistoryResponseBytes); // ACT var comm = new RingCommunications(Username, Password) { AuthRequest = mockHttpWebRequestAuth, DoorbotHistoryRequest = mockHttpWebRequestDoorbotHistory }; // Authenticate var actualSessionAuthObject = await comm.Authenticate(); // Acquire Doorbot History var actualDoorbotsHistoryList = await comm.GetDoorbotsHistory(); Assert.AreEqual(ExpectedDoorbotsHistoryList.Count, actualDoorbotsHistoryList.Count, "The DoorbotsHistoryList doesn't contain the same number of items as expected"); // Compare all itesm within the ExpectedList and the actual var cnt = 0; foreach (var expected in ExpectedDoorbotsHistoryList) { ObjectCompare(expected, actualDoorbotsHistoryList[cnt]); cnt++; } }
public async Task GetDoorbotsHistoryTest() { var session = new RingCommunications(Username, Password); await session.Authenticate(); var doorbotHistory = await session.GetDoorbotsHistory(); Assert.IsTrue(doorbotHistory.Count > 0, "No doorbot history items returned"); }
public async Task GetDoorbotsHistoryRecordingByInstanceTest() { var session = new RingCommunications(Username, Password); await session.Authenticate(); var doorbotHistory = await session.GetDoorbotsHistory(); Assert.IsTrue(doorbotHistory.Count > 0, "No doorbot history events were found"); var tempFilePath = Path.GetTempFileName(); await session.GetDoorbotHistoryRecording(doorbotHistory[0], tempFilePath); File.Delete(tempFilePath); }