Ejemplo n.º 1
0
        public void RegisterPackageFolder_should_register_tools_and_lib_if_tools_does_not_exist_and_lib_does_not_exist()
        {
            using (var tools = new DirectoryInfo(Utility.Tools).BeginModifying())
            using (var lib = new DirectoryInfo(Utility.Lib).BeginModifying())
            {
                // Arrange
                var envRepos = new EnvironmentRepository();

                // Act
                envRepos.RegisterPackageFolder();

                // Assert
                Assert.IsTrue(tools.Info.Exists);
                Assert.IsTrue(lib.Info.Exists);
            }
        }
Ejemplo n.º 2
0
        public void RegisterPackageFolder_should_register_tools_and_lib_if_tools_does_not_exist_and_lib_exists()
        {
            using (var tools = new DirectoryInfo(Utility.Tools).BeginModifying())
            using (var lib = new DirectoryInfo(Utility.Lib).BeginModifying())
            {
                // Arrange
                var fixture = new Fixture().Customize(new AutoMoqCustomization());

                var dummyLibLastWriteTime = new DirectoryInfo(Utility.Lib).CreateWithContent(fixture).LastWriteTime;

                var envRepos = new EnvironmentRepository();

                // Act
                envRepos.RegisterPackageFolder();

                // Assert
                Assert.IsTrue(tools.Info.Exists);
                Assert.AreNotEqual(dummyLibLastWriteTime, lib.Info.LastWriteTime);
            }
        }