コード例 #1
0
        public void GetDataFolder_WhenGivenDataFolderPath_ReturnsDataFolderPath()
        {
            string path = Path.Combine(TestDataLocator.GetMinecraftDataPath(), "data");

            string resultPath = DataFolderHelper.GetDataFolder(path);

            Assert.Equal(path, resultPath);
        }
コード例 #2
0
        public void GetDataFolder_WhenGivenRepoPath_ReturnsDataFolderPath()
        {
            string path = TestDataLocator.GetMinecraftDataPath();

            string resultPath = DataFolderHelper.GetDataFolder(path);

            Assert.Equal("data", resultPath.Split(Path.DirectorySeparatorChar).Last());
        }
コード例 #3
0
        public void GetDataFolder_WhenGivenInvalidPath_ThrowsException()
        {
            string path = Path.GetDirectoryName(TestDataLocator.GetMinecraftDataPath());

            Assert.Throws <InvalidDataPathException>(() => DataFolderHelper.GetDataFolder(path));
        }
コード例 #4
0
 public void GetDataFolder_WhenGivenNullPath_ThrowsException()
 {
     Assert.Throws <ArgumentNullException>(() => DataFolderHelper.GetDataFolder(null));
 }