示例#1
0
        public void ctor_WithStandardPath_ShouldCreateRootAndQueue ()
        {
            using (ITitanicBroker sut = new TitanicBroker ())
            {
                sut.Should ().NotBeNull ();

                var path = Path.Combine (AppDomain.CurrentDomain.BaseDirectory, _titanic_directory);
                var queue = Path.Combine (path, _titanic_queue);

                File.Exists (queue).Should ().BeTrue (string.Format ("because {0} should NOT have been created!", queue));

                // clean up
                File.Delete (queue);
                Directory.Delete (path);
            }
        }
示例#2
0
        public void ctor_WithNoneStandardPath_ShouldCreateRootAndQueueInIndicatedPath ()
        {
            var path = Path.Combine (Path.GetTempPath (), _titanic_directory);
            // create root for Titanic - it expects the root to exist(!)
            Directory.CreateDirectory (path);
            var queue = Path.Combine (path, _titanic_queue);

            using (ITitanicBroker sut = new TitanicBroker (_titanic_broker_address, path))
            {
                sut.Should ().NotBeNull ();

                try
                {
                    File.Exists (queue).Should ().BeTrue (string.Format ("because {0} should have been created!", queue));
                }
                finally
                {
                    // clean up
                    File.Delete (queue);
                    Directory.Delete (path);
                }
            }
        }