Beispiel #1
0
        public void TestSerializeRoundTrip()
        {
            string           serialized       = JObject.Parse(_serializer.Serialize(_deploymentConfig)).ToString();
            DeploymentConfig deploymentConfig = _serializer.Deserialize(serialized);
            string           roundTripJson    = JObject.Parse(_serializer.Serialize(deploymentConfig)).ToString();

            Assert.Equal(_deploymentConfig, deploymentConfig);
            Assert.Equal(serialized, roundTripJson);
        }
        public async Task TestPublishThenFetchDeploymentConfig()
        {
            string           data             = File.ReadAllText(_deploymentConfigFilePath);
            DeploymentConfig deploymentConfig = _serializer.Deserialize(data);
            await _deploymentRepository.PublishDeploymentConfig(deploymentConfig);

            DeploymentConfig newDeploymentConfig = await _deploymentRepository.FetchDeploymentConfig();

            Assert.Equal(_serializer.Serialize(deploymentConfig), _serializer.Serialize(newDeploymentConfig));
        }
 public Task PublishDeploymentConfig(DeploymentConfig deploymentConfig)
 {
     File.WriteAllText(_deploymentConfigPath, _deploymentConfigSerializer.Serialize(deploymentConfig));
     return(Task.CompletedTask);
 }
Beispiel #4
0
        private void SaveLocalDeploymentConfig(StorageAccountConnectionInfo connectionInfo)
        {
            string json = _deploymentConfigSerializer.Serialize(_deploymentConfig);

            SaveLocalDeploymentConfig(connectionInfo, json);
        }
        public Task PublishDeploymentConfig(DeploymentConfig deploymentConfig)
        {
            CloudBlockBlob blob = _blobContainer.GetBlockBlobReference(Constants.DeploymentConfigFileName);

            return(blob.UploadTextAsync(_serializer.Serialize(deploymentConfig)));
        }