Example #1
0
        public void EnvironmentUtilityUserHomeDirectoryReturnsValueFromEnvironment()
        {
            // Arrange
            var testBundle = new EnvironmentUtilityTestBundle();

            // Act
            var val = testBundle.EnvironmentUtility.UserHomeDirectory;

            // Assert
            Assert.IsNull(val);
            testBundle.MockEnvironment.VerifyGet(x => x.UserHomeDirectory, Times.Once());
        }
Example #2
0
        public void EnvironmentUtilityDirectorySeperatorReturnsValueFromPath()
        {
            // Arrange
            var testBundle = new EnvironmentUtilityTestBundle();

            // Act
            var val = testBundle.EnvironmentUtility.DirectorySeparatorChar;

            // Assert
            Assert.IsNotNull(val);
            testBundle.MockPath.VerifyGet(x => x.DirectorySeparatorChar, Times.Once());
        }
Example #3
0
        public void EnvironmentUtilityIsWindowsPlatformReturnsValueFromEnvironment()
        {
            // Arrange
            var testBundle = new EnvironmentUtilityTestBundle();

            // Act
            var val = testBundle.EnvironmentUtility.IsWindowsPlatform;

            // Assert
            Assert.IsFalse(val);
            testBundle.MockEnvironment.VerifyGet(x => x.IsWindowsPlatform, Times.Once());
        }
        public void EnvironmentUtilityIsWindowsPlatformReturnsValueFromEnvironment()
        {
            // Arrange
            var testBundle = new EnvironmentUtilityTestBundle();

            // Act
            var val = testBundle.EnvironmentUtility.IsWindowsPlatform;

            // Assert
            Assert.IsFalse(val);
            testBundle.MockEnvironment.VerifyGet(x => x.IsWindowsPlatform, Times.Once());
        }
        public void EnvironmentUtilityDirectorySeperatorReturnsValueFromPath()
        {
            // Arrange
            var testBundle = new EnvironmentUtilityTestBundle();

            // Act
            var val = testBundle.EnvironmentUtility.DirectorySeparatorChar;

            // Assert
            Assert.IsNotNull(val);
            testBundle.MockPath.VerifyGet(x => x.DirectorySeparatorChar, Times.Once());
        }
Example #6
0
        public void EnvironmentUtilityCombinePathReturnsValueFromPathCombine()
        {
            // Arrange
            var          testBundle    = new EnvironmentUtilityTestBundle();
            const string path1         = "path1";
            const string path2         = "path2";
            const string combineResult = "path1/path2";

            testBundle.MockPath.Setup(x => x.Combine(path1, path2)).Returns(combineResult);

            // Act
            var val = testBundle.EnvironmentUtility.CombinePath(path1, path2);

            // Assert
            Assert.AreSame(combineResult, val);
            testBundle.MockPath.Verify(x => x.Combine(path1, path2), Times.Once());
        }
        public void EnvironmentUtilityCombinePathReturnsValueFromPathCombine()
        {
            // Arrange
            var testBundle = new EnvironmentUtilityTestBundle();
            const string path1 = "path1";
            const string path2 = "path2";
            const string combineResult = "path1/path2";

            testBundle.MockPath.Setup(x => x.Combine(path1, path2)).Returns(combineResult);

            // Act
            var val = testBundle.EnvironmentUtility.CombinePath(path1, path2);

            // Assert
            Assert.AreSame(combineResult, val);
            testBundle.MockPath.Verify(x => x.Combine(path1, path2), Times.Once());
        }
        public void EnvironmentUtilityUserHomeDirectoryReturnsValueFromEnvironment()
        {
            // Arrange
            var testBundle = new EnvironmentUtilityTestBundle();

            // Act
            var val = testBundle.EnvironmentUtility.UserHomeDirectory;

            // Assert
            Assert.IsNull(val);
            testBundle.MockEnvironment.VerifyGet(x => x.UserHomeDirectory, Times.Once());
        }