public async Task TestDispose_NonReentrant()
        {
            _objectUnderTest = await KubectlContext.GetForClusterAsync(DefaultCluster, DefaultZone);

            _objectUnderTest.Dispose();
            _objectUnderTest.Dispose();

            PackageMock.Verify(p => p.GetMefService <IFileSystem>().File.Delete(It.IsAny <string>()), Times.Once);
        }
        public async Task TestDispose_DeletesConfigPath()
        {
            IDictionary <string, string> environment = new Dictionary <string, string>();

            SetupRunCommandGetEnvironment(commandEnvironment => environment = commandEnvironment);

            _objectUnderTest = await KubectlContext.GetForClusterAsync(DefaultCluster, DefaultZone);

            _objectUnderTest.Dispose();

            string expectedDeletePath = environment[KubectlContext.KubeConfigVariable];

            PackageMock.Verify(p => p.GetMefService <IFileSystem>().File.Delete(expectedDeletePath));
        }
Ejemplo n.º 3
0
        public void TestDispose_DeletesConfigPath()
        {
            _objectUnderTest.Dispose();

            _fileSystemMock.Verify(fs => fs.File.Delete(_kubeConfigPath));
        }