예제 #1
0
        public void An_Environment_Variable_Is_Equal_To_The_Path_It_Resolves_To()
        {
            var lhs = SmartFolder.FromEnvironmentVariable("TEMP");
            var rhs = new SmartFolder(ExpandEnvironmentVariables("%TEMP%"));

            lhs.Equals(rhs).Should().BeTrue();
        }
예제 #2
0
        public void Create_Using_Environment_Variable()
        {
            var sut = SmartFolder.FromEnvironmentVariable("TEMP");

            sut.ToString("O").Should().Be("%TEMP%");
            sut.ToString("G").Should().Be(ExpandEnvironmentVariables("%TEMP%") + @"\");
        }
예제 #3
0
        public void Absolute_Returns_The_Folder_With_An_Absolute_Path_And_Expands_Variables()
        {
            var lhs = SmartFolder.FromEnvironmentVariable("temp");
            var rhs = lhs.ToAbsolute();

            rhs.ToString("O").Should().NotContain("%", "environment variables must be expanded");
        }
예제 #4
0
        public void Create_Using_Environment_Variable_Throws_Exception_When_Null()
        {
            Action action = () => SmartFolder.FromEnvironmentVariable(null);

            action.Should().Throw <ArgumentNullException>();
        }