public void SetUp()
        {
            var applicationName = "new";
            var containerBuilder = new ServerContainerBuilder();

            containerBuilder.RegisterType<FileBasedConfigurationRepository>().AsImplementedInterfaces();

            _server = new Browser(new ServerBootstrapper(containerBuilder));

            sampleConfig = TestHelper.GetSampleConfig();

            _server.Post($"application/{applicationName}", context =>
            {
                context.HttpRequest();
                context.JsonBody(sampleConfig as object);
            });

            createdFilePath = Path.Combine(Directory.GetCurrentDirectory(), FileBasedConfigurationRepository.ConfigFolder, applicationName);

            isFileExist = File.Exists(createdFilePath);
        }
Ejemplo n.º 2
0
        public void SetUp()
        {
            const string applicationName = "new";

            database = new MongoClient(Connection).GetDatabase(DatabaseName);
            database.DropCollection(CollectionName);

            var containerBuilder = new ServerContainerBuilder();

            containerBuilder.Register(c => new MongoConfigurationRepository(Connection, DatabaseName)).AsImplementedInterfaces();

            _server = new Browser(new ServerBootstrapper(containerBuilder));

            sampleConfig = TestHelper.GetSampleConfig();

            _server.Post($"application/{applicationName}", context =>
            {
                context.HttpRequest();
                context.JsonBody(sampleConfig as object);
            });

            isConfigExist = database.GetCollection(CollectionName).Find(x => x[KeySelector] == applicationName).Any();
        }