示例#1
0
        public void LoadContentAsTest()
        {
            RunBeforeTests(_listTest);
            var fileManager     = new JsonFileManager();
            var resultingObject = fileManager.LoadContentAs <IEnumerable <FieldConfig> >(FilePath);
            var fieldConfigs    = resultingObject.ToList();
            var top1            = fieldConfigs.FirstOrDefault();

            Assert.IsNotNull(top1);
            Assert.IsTrue(top1.Required);
        }
示例#2
0
        public void PersistContentTest()
        {
            _listTest.Add(new FieldConfig
            {
                Name      = "Test 2",
                IsVisible = false,
                Required  = false
            });

            RunBeforeTests(_listTest);

            var fileManager     = new JsonFileManager();
            var resultingObject = fileManager.LoadContentAs <IEnumerable <FieldConfig> >(FilePath);
            var fieldConfigs    = resultingObject.ToList();

            Assert.IsTrue(fieldConfigs.Count == 2);
        }