Example #1
0
        public LibraryClient()
        {
            IDataStoreProvider provider = new TSettingsProvider();

            _settings = new KeyedDataStore(provider);

            if (!_settings.get("EchoServiceEndpoint", ref _echoServiceEndpointName))
            {
                throw new ApplicationException(string.Format("Missing Configuration element ''",
                                                             "EchoServiceEndpoint"));
            }
            Trace.WriteLine(string.Format("EchoServiceEndpoint='{0}'", _echoServiceEndpointName));

            if (!_settings.get("LibraryServiceEndpoint", ref _libraryServiceEndpointName))
            {
                throw new ApplicationException(string.Format("Missing Configuration element ''",
                                                             "LibraryServiceEndpoint"));
            }
            Trace.WriteLine(string.Format("LibraryServiceEndpoint='{0}'", _libraryServiceEndpointName));

            // Resolve streams out of resource fork.
            StreamFactory.Register("res", (path, args) =>
            {
                Assembly assembly   = Assembly.GetExecutingAssembly();
                string resourcePath = string.Format("{0}.{1}",
                                                    assembly.GetName().Name,
                                                    path);
                Trace.WriteLine(string.Format("StreamFactory::Create(res://{0})", resourcePath));
                Stream result = assembly.GetManifestResourceStream(resourcePath);
                return(result);
            });
        }
        public void KeyedDataStore_GetInteger()
        {
            int expected = 5977;

            trace("Expected : {0}", expected);
            int? actual = null;
            bool result = _store.get("integer-5977", ref actual);

            trace(" Actual : {0}", actual);

            Assert.AreEqual(expected, actual);
        }