public async Task BeforeEachAsync() { _processServiceMock = new Mock <IProcessService>(); PackageMock.Setup(p => p.ProcessService).Returns(_processServiceMock.Object); _fileSystemMock = new Mock <IFileSystem> { DefaultValueProvider = DefaultValueProvider.Mock }; _kubeConfigPath = Path.GetTempFileName(); _fileSystemMock.Setup(fs => fs.Path.GetTempFileName()).Returns(_kubeConfigPath); _processServiceMock.SetupRunCommandAsync().ReturnsResult(true); _objectUnderTest = new KubectlContext( _fileSystemMock.Object, _processServiceMock.ToLazy(), CredentialsStore.Default); await _objectUnderTest.InitClusterCredentialsAsync(s_defaultCluster); _mockedOutputAction = Mock.Of <Func <string, Task> >(); }