Example #1
0
        public void ReadEmbeddedFile_ShouldSuccess()
        {
            string fileContent = ReadEmbeddedFile.ReadEmbeddedConfigurationFile();

            Assert.IsNotNullOrEmpty(fileContent);
            Console.WriteLine(fileContent);
        }
Example #2
0
        public void ReadJsonConfiguration_ValidConfiguration_ShouldSuccess()
        {
            //string fullPath = "\\Files\\configuration.json";

            //JSONConfigurationReader reader = new JSONConfigurationReader(fullPath);
            //reader.LoadConfiguration();

            string json = ReadEmbeddedFile.ReadEmbeddedConfigurationFile();

            JSONConfigurationReader reader = new JSONConfigurationReader();

            reader.DeserializeContent(json);

            string result = reader.ToString();

            Assert.IsNotNullOrEmpty(result); // does json parse returns any values

            // use object model
            ConfigurationModel model = reader.ConfigurationValuesModel;

            Assert.IsNotNullOrEmpty(model.TFSAddress);

            Console.WriteLine(model.TFSAddress);
        }