Closed MarcelRoozekrans closed 5 years ago
Made mocking better possible by having interface in the kubeClient.ResourceClient<T> instead of the implementation.
kubeClient.ResourceClient<T>
Example:
var kubeClient = new Mock<IKubeApiClient>(); var secretClient = new Mock<ISecretClientV1>(); secretClient.Setup(x => x.Create(It.IsAny<SecretV1>(), It.IsAny<CancellationToken>())).ReturnsAsync(new SecretV1()); kubeClient.Setup(x => x.ResourceClient(It.IsAny<Func<IKubeApiClient, ISecretClientV1>>())).Returns(() => secretClient.Object);
Hi, thanks! I’m overseas for the next few days with no laptop and patchy internet access - I’ll look at this as soon as I get back :)
Thnx !
Thanks!
Made mocking better possible by having interface in the
kubeClient.ResourceClient<T>
instead of the implementation.Example: