Encapsulates a unit test that verifies that all references of an assembly are specified.
Inheritance: IdiomaticAssertion
 public void VerifyAssemblyThrowsWhenAnyReferenceIsNotSpecified()
 {
     var restrictiveReferences = new[]
     {
         typeof(object).Assembly,
         typeof(FactAttribute).Assembly,
         typeof(TheoryAttribute).Assembly
     };
     var sut = new RestrictiveReferenceAssertion(restrictiveReferences);
     Assert.Throws<RestrictiveReferenceException>(() => sut.Verify(typeof(TestBaseAttribute).Assembly));
 }
 public void VerifyAssemblyThrowsWhenAnyUnusedReferenceIsSpecified()
 {
     var restrictiveReferences = new[]
     {
         typeof(object).Assembly,
         typeof(XmlNode).Assembly,
         typeof(ISet<>).Assembly,
         typeof(TheoryAttribute).Assembly // Unused reference
     };
     var sut = new RestrictiveReferenceAssertion(restrictiveReferences);
     Assert.Throws<RestrictiveReferenceException>(() => sut.Verify(typeof(FactAttribute).Assembly));
 }
        public void RestrictiveReferencesIsCorrect()
        {
            var restrictiveReferences = new[]
            {
                typeof(object).Assembly,
                typeof(Enumerable).Assembly
            };
            var sut = new RestrictiveReferenceAssertion(restrictiveReferences);

            var actual = sut.RestrictiveReferences;

            Assert.Equal(restrictiveReferences, actual);
        }
 public void VerifyAssemblyDoesNotThrowWhenAllReferencesAreSpecified()
 {
     var restrictiveReferences = new[]
     {
         Assembly.Load("mscorlib"),
         Assembly.Load("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"),
         Assembly.Load("System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"),
         Assembly.Load("Ploeh.AutoFixture, Version=3.18.7.0, Culture=neutral, PublicKeyToken=b24654c590009d4f"),
         Assembly.Load("Ploeh.AutoFixture.Xunit, Version=3.18.7.0, Culture=neutral, PublicKeyToken=b24654c590009d4f"),
         Assembly.Load("xunit"),
         Assembly.Load("xunit.extensions")
     };
     var sut = new RestrictiveReferenceAssertion(restrictiveReferences);
     Assert.DoesNotThrow(() => sut.Verify(typeof(TestBaseAttribute).Assembly));
 }
 public void SutIsIdiomaticAssemblyAssertion()
 {
     var sut = new RestrictiveReferenceAssertion();
     Assert.IsAssignableFrom<IdiomaticAssertion>(sut);
 }