示例#1
0
        public async Task JobsClient_Logs_HappyPath()
        {
            var connection     = new Mock <IConnection>();
            var logsConnection = new Mock <IConnection>();

            logsConnection.Setup(c => c.Get <IList <JobLog> >(ApiUrls.JobsLogs("j123abc"), null))
            .ReturnsAsync(() =>
            {
                var json = System.IO.File.ReadAllText("./Fixtures/Jobs_Logs.json");
                return(JsonConvert.DeserializeObject <IList <JobLog> >(json));
            });

            var jobsClient = new JobsClient(connection.Object, logsConnection.Object);
            var logs       = await jobsClient.Logs("j123abc");

            Assert.IsNotNull(logs);
        }