コード例 #1
0
        public void AddReverseReference()
        {
            TrackedAssembly assembly  = new TrackedAssembly(_assemblyDefinition);
            TrackedAssembly assembly2 = new TrackedAssembly(_assemblyDefinition);

            assembly.AddReverseReference(assembly2);

            Assert.That(assembly.ReverseReferences, Has.Member(assembly2));
        }
コード例 #2
0
        public void MarkModified_AlsoMarksReverseReference()
        {
            TrackedAssembly assembly  = new TrackedAssembly(_assemblyDefinition);
            TrackedAssembly assembly2 = new TrackedAssembly(_assemblyDefinition);

            assembly.AddReverseReference(assembly2);
            Assert.That(assembly.IsModified, Is.False);
            Assert.That(assembly2.IsModified, Is.False);

            assembly.MarkModified();

            Assert.That(assembly.IsModified, Is.True);
            Assert.That(assembly2.IsModified, Is.True);
        }
コード例 #3
0
        public void MarkModified_CanHandleCyclicReferences()
        {
            TrackedAssembly assembly  = new TrackedAssembly(_assemblyDefinition);
            TrackedAssembly assembly2 = new TrackedAssembly(_assemblyDefinition);
            TrackedAssembly assembly3 = new TrackedAssembly(_assemblyDefinition);

            assembly.AddReverseReference(assembly2);
            assembly2.AddReverseReference(assembly3);
            assembly3.AddReverseReference(assembly);
            Assert.That(assembly.IsModified, Is.False);
            Assert.That(assembly2.IsModified, Is.False);
            Assert.That(assembly3.IsModified, Is.False);

            assembly.MarkModified();

            Assert.That(assembly.IsModified, Is.True);
            Assert.That(assembly2.IsModified, Is.True);
            Assert.That(assembly3.IsModified, Is.True);
        }