示例#1
0
文件: UnitTest.cs 项目: tub5/RingApi
        public async Task GetDoorbotsHistoryRecordingByIdTest()
        {
            if (!IsSessionActive())
            {
                return;
            }

            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].Id, tempFilePath);

            File.Delete(tempFilePath);
        }
示例#2
0
        public async Task GetDoorbotsHistoryRecordingByInstanceTest()
        {
            var session = new Api.Session(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);
        }