Skip to content

Instantly share code, notes, and snippets.

@timReynolds
Created April 21, 2016 10:02
Show Gist options
  • Save timReynolds/41d6e0cd03aecb6ad3133c2a9fa11c37 to your computer and use it in GitHub Desktop.
Save timReynolds/41d6e0cd03aecb6ad3133c2a9fa11c37 to your computer and use it in GitHub Desktop.
Verify SimpleInjector NUnit test
using System.Web.Http;
using NUnit.Framework;
using PF.Presentation.Api.Extensions.ContainerExtensions;
using SimpleInjector;
namespace PF.Presentation.Api.UnitTests.Extensions
{
[TestFixture]
public class VerifyContainer
{
[Test]
public void SimpleInjector_Verify_ShouldNotThrowException()
{
// Arrange
var httpConfiguration = new HttpConfiguration();
var container = new Container();
// Act
container.RegisterComponents(httpConfiguration);
container.SuppressDisposableWarningsWhereSafeToDoSo();
// Assert
Assert.DoesNotThrow( () => container.Verify() );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment