Exemple #1
0
        public void SerializationTestEmptyException()
        {
            var harness = new ServiceHandlerContainer();

            try
            {
                harness.Start();
            }
            catch (PayloadSerializerCollectionIsEmptyException pex)
            {
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }
Exemple #2
0
        public void Test1()
        {
            var container = new ServiceHandlerContainer();

            var sr = container.Serialization.Add(new JsonContractSerializer());

            container.Start();

            var test = new Blah {
                Message = "Hmm"
            };

            var blob = container.Serialization.SerializeToBlob(test);

            var resolve = container.Serialization.DeserializeToObject <Blah>(blob);

            Assert.AreEqual(test, resolve);
        }
Exemple #3
0
        public void SerializationTestAddClear()
        {
            var harness = new ServiceHandlerContainer();

            harness.Serialization.Add(new JsonContractSerializer());

            Assert.AreEqual(harness.Serialization.Count, 1);

            harness.Serialization.Clear();
            Assert.AreEqual(harness.Serialization.Count, 0);

            harness.Serialization.Add(new JsonContractSerializer());
            Assert.AreEqual(harness.Serialization.Count, 1);

            try
            {
                harness.Start();
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }
        /// <summary>
        /// THis method returns the default scheduler container.
        /// </summary>
        protected virtual ServiceHandlerContainer InitialiseServiceHandlerContainer()
        {
            var container = new ServiceHandlerContainer(Policies.ServiceHandlers);

            return(container);
        }