示例#1
0
        public void References()
        {
            var references = typeof(CecilAssemblyTest).Assembly.GetReferencedAssemblies().Select(a => a.FullName);

            Assert.That(CecilAssemblyTest.GetAssembly().References.Select(r => r.Identifier),
                        Is.EquivalentTo(references));
        }
示例#2
0
        public void Equals(bool same)
        {
            var assembly1 = CecilAssemblyTest.GetAssembly();
            var assembly2 = same ? CecilAssemblyTest.GetAssembly() : CecilAssemblyTest.GetOtherAssembly();

            Assert.That(assembly1.Equals(assembly2), Is.EqualTo(same));
            Assert.That(assembly1 == assembly2, Is.EqualTo(same));
            Assert.That(assembly1 != assembly2, Is.EqualTo(!same));
        }
示例#3
0
        public void Version()
        {
            var expected = typeof(CecilAssemblyTest).Assembly.GetName().Version;

            Assert.That(CecilAssemblyTest.GetAssembly().Version, Is.EqualTo(expected));
        }
示例#4
0
 public void Types()
 {
     Assert.That(CecilAssemblyTest.GetAssembly().Types,
                 Has.Some.Matches <Type>(t => t.Identifier == typeof(CecilAssemblyTest).FullName));
 }
示例#5
0
 public void Name()
 {
     Assert.That(CecilAssemblyTest.GetAssembly().Name,
                 Is.EqualTo(typeof(CecilAssemblyTest).Assembly.GetName().Name));
 }
示例#6
0
 public void FileName()
 {
     Assert.That(CecilAssemblyTest.GetAssembly().FileName,
                 Is.EqualTo(typeof(CecilAssemblyTest).Assembly.Location));
 }
示例#7
0
 public void Attributes()
 {
     Assert.That(CecilAssemblyTest.GetAssembly().Attributes,
                 Has.Some.Matches <Attribute>(attribute =>
                                              attribute.Type.Identifier == typeof(TargetFrameworkAttribute).FullName));
 }