Example #1
0
        public ConfigResponse <List <ConfigItem> > GetAllForApp(ConfigItem request)
        {
            ConfigResponse <List <ConfigItem> > retval = new ConfigResponse <List <ConfigItem> >();

            using (var db = new CentralConfigDb())
            {
                ConfigDataManager manager = new ConfigDataManager(db);
                retval.Data    = manager.GetAllForApp(request);
                retval.Status  = System.Net.HttpStatusCode.OK;
                retval.Message = "Config items found";
            }

            return(retval);
        }
Example #2
0
        public void GetAllForApp_ValidApp_ReturnsAllConfigItemsForApp()
        {
            //  Arrange
            ConfigDataManager manager = new ConfigDataManager(mockContext.Object);

            //  Act
            var result = manager.GetAllForApp(new ConfigItem {
                Application = "SomeOtherApp"
            });

            //  Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(5, result.Count);
        }