public async void GetModuleLogsTest() { var client = new Mock <IKubernetes>(MockBehavior.Strict); var k8sRuntimeInfo = new KubernetesRuntimeInfoProvider(PodwatchNamespace, client.Object); var result = await k8sRuntimeInfo.GetModuleLogs("module", true, Option.None <int>(), Option.None <int>(), CancellationToken.None); Assert.True(result.Length == 0); }
public async void GetModuleLogsTest() { var response = new HttpOperationResponse <Stream>(); response.Request = new System.Net.Http.HttpRequestMessage(); response.Body = new MemoryStream(); var client = new Mock <IKubernetes>(MockBehavior.Strict); client.Setup(kc => kc.ReadNamespacedPodLogWithHttpMessagesAsync(It.IsAny <string>(), It.IsAny <string>(), null, true, null, null, null, null, null, null, null, It.IsAny <CancellationToken>())).ReturnsAsync(() => response); var k8sRuntimeInfo = new KubernetesRuntimeInfoProvider(PodwatchNamespace, client.Object); var result = await k8sRuntimeInfo.GetModuleLogs("module", true, Option.None <int>(), Option.None <int>(), CancellationToken.None); Assert.True(result.Length == 0); }
public async void GetModuleLogsTest() { var logs = Encoding.UTF8.GetBytes("some logs"); var response = new HttpOperationResponse <Stream> { Request = new System.Net.Http.HttpRequestMessage(), Body = new MemoryStream(logs) }; var client = new Mock <IKubernetes>(MockBehavior.Strict); client.Setup(kc => kc.ReadNamespacedPodLogWithHttpMessagesAsync(It.IsAny <string>(), It.IsAny <string>(), null, true, null, null, null, null, null, null, null, It.IsAny <CancellationToken>())).ReturnsAsync(() => response); var moduleManager = new Mock <IModuleManager>(MockBehavior.Strict); var runtimeInfo = new KubernetesRuntimeInfoProvider(Namespace, client.Object, moduleManager.Object); var result = await runtimeInfo.GetModuleLogs("module", true, Option.None <int>(), Option.None <int>(), CancellationToken.None); Assert.True(result.Length == logs.Length); }