Пример #1
0
        public void Format()
        {
            Guid id = Guid.NewGuid();
            IDictionary<string, object> dic = new Dictionary<string, object>();
            dic.Add("XYZ", id);

            DictionaryTextFormatter formatter = new DictionaryTextFormatter();
            string result = formatter.Format<string, object>(dic);
            Assert.NotNull(result);
        }
Пример #2
0
 public string Format(BlueSpider.Common.Settings.ISettingsMgr mgr)
 {
     string result = "";
     if (mgr.Values.Count > 0)
     {
         DictionaryTextFormatter dtf = new DictionaryTextFormatter();
         dtf.KeyValuePairFormat = SettingFormat;
         dtf.SeparatorFormat = SeparatorFormat;
         result = dtf.Format(mgr.Values);
     }
     return result;
 }
Пример #3
0
        public void Format()
        {
            // it just uses a DictionaryTextFormatter

            var mockMgr = new Mock<IParamMgr>();
            Guid id = Guid.NewGuid();
            IDictionary<string, object> items = new Dictionary<string, object>();
            items.Add("XYZ", id);

            using (RecordExpectations recorder = RecorderManager.StartRecording())
            {
                recorder.ExpectAndReturn(mockMgr.Values, items).RepeatAlways();
                DictionaryTextFormatter dtf = new DictionaryTextFormatter();
                recorder.ExpectAndReturn(dtf.Format<string, object>(items), null);
            }

            ParamMgrTextFormatter formatter = new ParamMgrTextFormatter();
            string result = formatter.Format(mockMgr);
            MockManager.Verify();
        }