public async Task GetDevicesTest() { var session = new RingCommunications(Username, Password); await session.Authenticate(); var devices = await session.GetRingDevices(); Assert.IsTrue(devices.Chimes.Count > 0 && devices.Doorbots.Count > 0, "No doorbots and/or chimes returned"); }
public async Task GetRingDevices_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 mockHttpWebRequestDevices = CreateMockHttpWebRequest(HttpStatusCode.NotModified, "A-OK", ExpectedDevicesResponseBytes); // ACT var comm = new RingCommunications(Username, Password) { AuthRequest = mockHttpWebRequestAuth, DevicesRequest = mockHttpWebRequestDevices }; // Authenticate var actualSessionAuthObject = await comm.Authenticate(); var actualDevices = await comm.GetRingDevices(); Assert.IsTrue(actualDevices.Chimes.Count > 0 && actualDevices.Doorbots.Count > 0, "No doorbots and/or chimes returned"); }
public async Task GetDevicesUnauthenticatedTest() { var session = new RingCommunications(Username, Password); await session.GetRingDevices(); }