Exemple #1
0
        public void TestSavingConfigOnCreateBundleWithString()
        {
            var quickDeployConfig = new QuickDeployConfig
            {
                AssetBundleFileName = "testbundle"
            };
            var inputConfig = new QuickDeployConfig.EditorConfiguration();

            quickDeployConfig.SaveEditorConfiguration(inputConfig, TestConfigurationPath);

            var outputConfigurationJson = File.ReadAllText(TestConfigurationPath);
            var outputConfig            =
                JsonUtility.FromJson <QuickDeployConfig.EditorConfiguration>(outputConfigurationJson);

            Assert.AreEqual(outputConfig.assetBundleFileName, quickDeployConfig.AssetBundleFileName);
        }
        public void TestSavingConfigOnCreateBundleWithEmptyString()
        {
            var quickDeployConfig = new QuickDeployConfig
            {
                AssetBundleFileName = ""
            };

            var inputConfig = new QuickDeployConfig.EditorConfiguration();

            quickDeployConfig.SaveEditorConfiguration(QuickDeployWindow.ToolBarSelectedButton.CreateBundle, inputConfig,
                                                      TestConfigurationPath);

            var outputConfigurationJson = File.ReadAllText(TestConfigurationPath);
            var outputConfig            =
                JsonUtility.FromJson <QuickDeployConfig.EditorConfiguration>(outputConfigurationJson);

            Assert.IsEmpty(outputConfig.assetBundleFileName);
        }
        public void TestSavingConfigOnDeployBundleWithString()
        {
            var quickDeployConfig = new QuickDeployConfig
            {
                CloudCredentialsFileName = "testcredentials",
                AssetBundleFileName      = "testbundle",
                CloudStorageBucketName   = "testbucket",
                CloudStorageObjectName   = "testobject"
            };

            var inputConfig = new QuickDeployConfig.EditorConfiguration();

            quickDeployConfig.SaveEditorConfiguration(QuickDeployWindow.ToolBarSelectedButton.DeployBundle, inputConfig,
                                                      TestConfigurationPath);

            var outputConfigurationJson = File.ReadAllText(TestConfigurationPath);
            var outputConfig            =
                JsonUtility.FromJson <QuickDeployConfig.EditorConfiguration>(outputConfigurationJson);

            Assert.AreEqual(outputConfig.cloudCredentialsFileName, quickDeployConfig.CloudCredentialsFileName);
            Assert.AreEqual(outputConfig.assetBundleFileName, quickDeployConfig.AssetBundleFileName);
            Assert.AreEqual(outputConfig.cloudStorageBucketName, quickDeployConfig.CloudStorageBucketName);
            Assert.AreEqual(outputConfig.cloudStorageObjectName, quickDeployConfig.CloudStorageObjectName);
        }
        public void TestSavingConfigOnCreateBundleWithString()
        {
            var quickDeployConfig = new QuickDeployConfig
            {
                AssetBundleFileName      = "testbundle",
                CloudCredentialsFileName = "testcredentials",
                CloudStorageBucketName   = "testbucketname",
                CloudStorageObjectName   = "testobjectname"
            };
            var inputConfig = new QuickDeployConfig.EditorConfiguration();

            quickDeployConfig.SaveEditorConfiguration(QuickDeployWindow.ToolBarSelectedButton.CreateBundle, inputConfig,
                                                      TestConfigurationPath);

            var outputConfigurationJson = File.ReadAllText(TestConfigurationPath);
            var outputConfig            =
                JsonUtility.FromJson <QuickDeployConfig.EditorConfiguration>(outputConfigurationJson);

            Assert.AreEqual(outputConfig.assetBundleFileName, quickDeployConfig.AssetBundleFileName);

            Assert.IsEmpty(outputConfig.cloudCredentialsFileName, "Cloud credentials should not have been saved. Should be empty.");
            Assert.IsEmpty(outputConfig.cloudStorageBucketName, "Cloud storage bucket should not have been saved. Should be empty.");
            Assert.IsEmpty(outputConfig.cloudStorageObjectName, "Cloud storage object should not have been saved. Should be empty.");
        }