diff --git a/clio.tests/Command/K8SCommandTests.cs b/clio.tests/Command/K8SCommandTests.cs new file mode 100644 index 00000000..5a137262 --- /dev/null +++ b/clio.tests/Command/K8SCommandTests.cs @@ -0,0 +1,33 @@ +using Autofac; +using Clio.Common.K8; +using FluentAssertions; +using k8s; +using k8s.Exceptions; +using NSubstitute; +using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Clio.Tests.Command +{ + [TestFixture] + internal class K8SCommandTests: BaseClioModuleTests + { + override protected void AdditionalRegistrations(ContainerBuilder containerBuilder) { + base.AdditionalRegistrations(containerBuilder); + containerBuilder.Register(provider => { + throw new KubernetesException("Kubernetes cannot be recognized."); + }).As(); + } + + [Test] + public void CreateK8SCommand_shouldthrowexception_ifKubernetesCannotBeRecognized() { + Action act = () => Container.Resolve(); + act.Should().Throw().WithInnerException() + .Which.Message.Should().BeEquivalentTo("Kubernetes cannot be recognized."); + } + } +} diff --git a/clio/K8CommandsTests.cs b/clio/K8CommandsTests.cs new file mode 100644 index 00000000..593e3976 --- /dev/null +++ b/clio/K8CommandsTests.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Clio +{ + internal class K8CommandsTests + { + } +}