public void WatchedFileReturnsDefaultSortStrategyWhenGetSortStrategyCalled()
        {
            // Arrange
            var testBundle = new WatchedFileTestBundle();
            var strategy   = new SimpleSortStrategy();

            testBundle.MockServiceProvider.Setup(x => x.ProvideSortStrategy(null)).Returns(strategy);

            // Act & Assert
            Assert.AreSame(strategy, testBundle.WatchedFile.SortStrategy);
        }
        public void WatchedFileReturnsSetSortStrategyWhenGetSortStrategyCalled()
        {
            // Arrange
            var testBundle = new WatchedFileTestBundle();
            var strategy   = new SimpleSortStrategy();

            // Act
            testBundle.WatchedFile.SortStrategy = strategy;

            // Assert
            Assert.AreSame(strategy, testBundle.WatchedFile.SortStrategy);
        }
        public void SimpleSortStrategy_NewFileName_FirstLetterOfFileNameUsedForSubDirectory()
        {
            // Arrange
            var strategy = new SimpleSortStrategy();
            var dir = Utilities.IsWindowsPlatform ? @"C:\folder" : "/folder";

            // Act
            var newName = strategy.NewFileName(dir, "test.txt");

            // Assert
            var expected = Utilities.IsWindowsPlatform ? @"C:\folder\t\test.txt" : "/folder/t/test.txt";

            Assert.AreEqual(expected, newName);
        }
Beispiel #4
0
        public void SimpleSortStrategy_NewFileName_FirstLetterOfFileNameUsedForSubDirectory()
        {
            // Arrange
            var strategy = new SimpleSortStrategy();
            var dir      = Utilities.IsWindowsPlatform ? @"C:\folder" : "/folder";

            // Act
            var newName = strategy.NewFileName(dir, "test.txt");

            // Assert
            var expected = Utilities.IsWindowsPlatform ? @"C:\folder\t\test.txt" : "/folder/t/test.txt";

            Assert.AreEqual(expected, newName);
        }
        public void WatchedFileReturnsSetSortStrategyWhenGetSortStrategyCalled()
        {
            // Arrange
            var testBundle = new WatchedFileTestBundle();
            var strategy = new SimpleSortStrategy();

            // Act
            testBundle.WatchedFile.SortStrategy = strategy;

            // Assert
            Assert.AreSame(strategy, testBundle.WatchedFile.SortStrategy);
        }
        public void WatchedFileReturnsDefaultSortStrategyWhenGetSortStrategyCalled()
        {
            // Arrange
            var testBundle = new WatchedFileTestBundle();
            var strategy = new SimpleSortStrategy();

            testBundle.MockServiceProvider.Setup(x => x.ProvideSortStrategy(null)).Returns(strategy);

            // Act & Assert
            Assert.AreSame(strategy, testBundle.WatchedFile.SortStrategy);
        }