-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03fcfe6
commit 00c70ca
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Kubernetes>(provider => { | ||
throw new KubernetesException("Kubernetes cannot be recognized."); | ||
}).As<IKubernetes>(); | ||
} | ||
|
||
[Test] | ||
public void CreateK8SCommand_shouldthrowexception_ifKubernetesCannotBeRecognized() { | ||
Action act = () => Container.Resolve<k8Commands>(); | ||
act.Should().Throw<Exception>().WithInnerException<KubernetesException>() | ||
.Which.Message.Should().BeEquivalentTo("Kubernetes cannot be recognized."); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
{ | ||
} | ||
} |