public void WatchDirectoriesInitializedNull() { // Arrange & Act var testBundle = new WatchDirectoryTestBundle(); // Assert Assert.AreEqual(new List <WatchDirectory>(), testBundle.WatchDirectories); }
public void WatchDirectory_ConstructedWithDefaults() { // Arrange & Act var testBundle = new WatchDirectoryTestBundle(); // Assert Assert.AreEqual(null, testBundle.WatchDirectory.FileExtensions, "FileExtensions"); Assert.AreEqual(null, testBundle.WatchDirectory.Path, "Path"); Assert.AreEqual(null, testBundle.WatchDirectory.SortStrategy, "SortStrategy"); Assert.AreEqual(OperationMode.Unknown, testBundle.WatchDirectory.Mode, "Mode"); Assert.AreEqual(false, testBundle.WatchDirectory.IncludeSubDirectories, "IncludeSubDirectories"); }
public void WatchDirectoriesConfiguredProperly() { // Arrange var testBundle = new WatchDirectoryTestBundle(); var mockWatchDirectory = new Mock <WatchDirectory>(); testBundle.MockServiceLocator.Setup(x => x.ProvideDefaultWatchDirectory()).Returns(mockWatchDirectory.Object); // Act testBundle.WatchDirectories.PopulateWithDefaults(); // Assert Assert.IsNotNull(testBundle.WatchDirectories); Assert.AreEqual(1, testBundle.WatchDirectories.Count); }
public void WatchDirectoriesConfiguredProperly() { // Arrange var testBundle = new WatchDirectoryTestBundle(); var mockWatchDirectory = new Mock<WatchDirectory>(); testBundle.MockServiceLocator.Setup(x => x.ProvideDefaultWatchDirectory()).Returns(mockWatchDirectory.Object); // Act testBundle.WatchDirectories.PopulateWithDefaults(); // Assert Assert.IsNotNull(testBundle.WatchDirectories); Assert.AreEqual(1, testBundle.WatchDirectories.Count); }
public void WatchDirectoriesEnumeratorIsCorrectForGeneric() { // Arrange var testBundle = new WatchDirectoryTestBundle(); var mockWatchDirectory = new Mock <WatchDirectory>(); testBundle.MockServiceLocator.Setup(x => x.ProvideDefaultWatchDirectory()).Returns(mockWatchDirectory.Object); testBundle.WatchDirectories.PopulateWithDefaults(); // Act var it = testBundle.WatchDirectories.GetEnumerator(); // Assert Assert.AreEqual(true, it.MoveNext()); Assert.IsNotNull(it.Current); Assert.AreEqual(false, it.MoveNext()); }
public void WatchDirectory_PopulateWithDefaults_NotOnWindows_ConfiguresObjectProperly() { // Arrange var testBundle = new WatchDirectoryTestBundle(); testBundle.MockEnvironment.SetupGet(x => x.IsWindowsPlatform).Returns(false); // Act testBundle.WatchDirectory.PopulateWithDefaults(); // Assert const string expectedDirectory = "/"; Assert.AreEqual("jpg,jpeg,gif,tiff,png", testBundle.WatchDirectory.FileExtensions, "FileExtensions"); Assert.AreEqual(expectedDirectory, testBundle.WatchDirectory.Path, "Path"); Assert.AreEqual("Simple", testBundle.WatchDirectory.SortStrategy, "SortStrategy"); Assert.AreEqual(OperationMode.Unknown, testBundle.WatchDirectory.Mode, "Mode"); Assert.AreEqual(false, testBundle.WatchDirectory.IncludeSubDirectories, "IncludeSubDirectories"); }
public void WatchDirectory_ObjectSettersWorkCorrectly() { // Arrange var testBunle = new WatchDirectoryTestBundle(); // Act testBunle.WatchDirectory.FileExtensions = "jpg,jpeg"; testBunle.WatchDirectory.IncludeSubDirectories = true; testBunle.WatchDirectory.Mode = OperationMode.SortOnly; testBunle.WatchDirectory.Path = "D:\\"; testBunle.WatchDirectory.SortStrategy = "SortStrategy"; // Assert Assert.AreEqual("jpg,jpeg", testBunle.WatchDirectory.FileExtensions, "FileExtensions"); Assert.AreEqual("D:\\", testBunle.WatchDirectory.Path, "Path"); Assert.AreEqual("SortStrategy", testBunle.WatchDirectory.SortStrategy, "SortStrategy"); Assert.AreEqual(OperationMode.SortOnly, testBunle.WatchDirectory.Mode, "Mode"); Assert.AreEqual(true, testBunle.WatchDirectory.IncludeSubDirectories, "IncludeSubDirectories"); }
public void WatchDirectoriesEnumeratorIsCorrectForGeneric() { // Arrange var testBundle = new WatchDirectoryTestBundle(); var mockWatchDirectory = new Mock<WatchDirectory>(); testBundle.MockServiceLocator.Setup(x => x.ProvideDefaultWatchDirectory()).Returns(mockWatchDirectory.Object); testBundle.WatchDirectories.PopulateWithDefaults(); // Act var it = testBundle.WatchDirectories.GetEnumerator(); // Assert Assert.AreEqual(true, it.MoveNext()); Assert.IsNotNull(it.Current); Assert.AreEqual(false, it.MoveNext()); }
public void WatchDirectoriesInitializedNull() { // Arrange & Act var testBundle = new WatchDirectoryTestBundle(); // Assert Assert.AreEqual(new List<WatchDirectory>(), testBundle.WatchDirectories); }