Ejemplo n.º 1
0
            public void Add_same_file_and_dependency_twice()
            {
                // Arrange
                var tracker = new TestableDependencyTracker();

                // Act
                tracker.Add("some post", "layout 1");
                tracker.Add("some post", "layout 1");

                // Assert
                Assert.That(tracker.FileDependencies["some post"],
                    Is.EquivalentTo(new HashSet<string> {"layout 1"}));

                Assert.That(tracker.DependentFiles.Keys, Contains.Item("layout 1"));
                Assert.That(tracker.DependentFiles["layout 1"], Contains.Item("some post"));
            }
Ejemplo n.º 2
0
            public void Add_a_file_with_no_dependencies()
            {
                // Arrange
                var tracker = new TestableDependencyTracker();

                // Act
                tracker.Add("some template", null);

                // Assert
                Assert.That(tracker.DependentFiles, Is.Empty);
                Assert.That(tracker.FileDependencies, Is.Empty);
            }
Ejemplo n.º 3
0
            public void Add_two_dependencies_for_a_file()
            {
                // Arrange
                var tracker = new TestableDependencyTracker();

                // Act
                tracker.Add("some post", "layout 1");
                tracker.Add("some post", "some component");

                // Assert
                Assert.That(tracker.FileDependencies["some post"],
                    Is.EquivalentTo(new HashSet<string> {"layout 1", "some component"}));

                Assert.That(tracker.DependentFiles["layout 1"], Contains.Item("some post"));
                Assert.That(tracker.DependentFiles["some component"], Contains.Item("some post"));
            }