Esempio n. 1
0
 public void GetDefaultServerConfigurationFileMethod()
 {
     using (Stream _defaultConfigurationFile = ResourcesManagement.GetDefaultServerConfigurationFile())
     {
         Assert.IsNotNull(_defaultConfigurationFile);
     }
 }
        /// <summary>
        /// Creates the default <see cref="CASConfiguration"/>
        /// </summary>
        /// <returns>The default <see cref="CASConfiguration"/> instance</returns>
        internal static CASConfiguration CreateDefault()
        {
            CurrentDirectory = string.Empty;
            Stream _inputStream = ResourcesManagement.GetDefaultServerConfigurationFile();
            DataContractSerializer serializer = new DataContractSerializer(typeof(CASConfiguration));
            XmlTextReader          reader     = new XmlTextReader(_inputStream);
            CASConfiguration       CASConfigurationToBeReturned = serializer.ReadObject(reader, false) as CASConfiguration;

            TestIfProcessBindingsAreCreatedAndCreateIfItIsNull(CASConfigurationToBeReturned);
            if (CASConfigurationToBeReturned == null)
            {
                CASConfigurationToBeReturned = new CASConfiguration();
                TestIfProcessBindingsAreCreatedAndCreateIfItIsNull(CASConfigurationToBeReturned);
            }
            return(CASConfigurationToBeReturned);
        }