public CommandDetails(CommandDetails details)
 {
     this.Session = details.Session;
     this.Parent = details.Parent;
     this.CollectionName = details.CollectionName;
     this.CollectionExpression = details.CollectionExpression;
     this.DerivedCollectionName = details.DerivedCollectionName;
     this.DerivedCollectionExpression = details.DerivedCollectionExpression;
     this.DynamicPropertiesContainerName = details.DynamicPropertiesContainerName;
     this.FunctionName = details.FunctionName;
     this.ActionName = details.ActionName;
     this.KeyValues = details.KeyValues;
     this.NamedKeyValues = details.NamedKeyValues;
     this.EntryData = details.EntryData;
     this.Filter = details.Filter;
     this.FilterExpression = details.FilterExpression;
     this.FilterExpression = details.FilterExpression;
     this.SkipCount = details.SkipCount;
     this.TopCount = details.TopCount;
     this.ExpandAssociations = details.ExpandAssociations;
     this.SelectColumns = details.SelectColumns;
     this.OrderbyColumns = details.OrderbyColumns;
     this.ComputeCount = details.ComputeCount;
     this.IncludeCount = details.IncludeCount;
     this.LinkName = details.LinkName;
     this.LinkExpression = details.LinkExpression;
     this.BatchEntries = details.BatchEntries;
 }
Example #2
0
        public TokenizerTest()
        {
            SimpleDictionary dict = new SimpleDictionary();
            dict.Add("testing");

            tokenizer = new Tokenizer(dict);
        }
        public void creates_save_path()
        {
            var vars = new SimpleDictionary<string, string>();

            theLoader.Save(vars.Values(), "vars.config");

            Assert.AreEqual("vars.config", theFileSystem.LastSavePath);
        }
        public void creates_save_contents()
        {
            var vars = new SimpleDictionary<string, string>();
            vars.Set("one", "two");
            vars.Set("three", "four five");

            theLoader.Save(vars.Values(), "vars.config");

            Assert.AreEqual("#var {one} {two}\n#var {three} {four five}\n", theFileSystem.LastSaveContent);
        }
 public CommandDetails(Session session, FluentCommand parent, SimpleDictionary<object, IDictionary<string, object>> batchEntries)
 {
     this.Session = session;
     this.Parent = parent;
     this.SkipCount = -1;
     this.TopCount = -1;
     this.ExpandAssociations = new List<KeyValuePair<string, ODataExpandOptions>>();
     this.SelectColumns = new List<string>();
     this.OrderbyColumns = new List<KeyValuePair<string, bool>>();
     this.BatchEntries = batchEntries;
 }
Example #6
0
        public ErrorModelTest()
        {
            dictionary = new SimpleDictionary();
            dictionary.Add("actress");
            dictionary.Add("cress");
            dictionary.Add("caress");
            dictionary.Add("access");
            dictionary.Add("across");
            dictionary.Add("acres");

            errorModel = new ErrorModel(dictionary);
        }
 internal FluentCommand(Session session, FluentCommand parent, SimpleDictionary<object, IDictionary<string, object>> batchEntries)
 {
     _details = new CommandDetails(session, parent, batchEntries);
 }
        public void SupportsDictionarySerialization()
        {
            var o = new SimpleDictionary();
            o.Add(1, "one");
            o.Add(2, "two");
            o.CustomProperty = "Numbers";

            var s = new FlexiXmlSerializer();

            var xml = s.Serialize(o);

            var has_keys_element =
                (from e in xml.Elements()
                 where e.Name == "Keys"
                 select e).Any();

            var has_values_element =
                (from e in xml.Elements()
                 where e.Name == "Values"
                 select e).Any();

            // keys and values are skipped from serialization by default
            Assert.IsFalse(has_keys_element);
            Assert.IsFalse(has_values_element);

            var o2 = s.Deserialize<SimpleDictionary>(xml);

            Assert.IsNotNull(o2);
            Assert.AreNotSame(o, o2);
            Assert.AreEqual(o.CustomProperty, o2.CustomProperty);
            Assert.AreEqual(2, o2.Count);

            Assert.AreEqual(1, o2.Keys.First());
            Assert.AreEqual("one", o2.Values.First());

            Assert.AreEqual(2, o2.Keys.Skip(1).First());
            Assert.AreEqual("two", o2.Values.Skip(1).First());
        }
        public void SetUp()
        {
            theReplacer = new VariableReplacer();
            theLocator = new InMemoryServiceLocator();
            theGameState = new StubGameState();
            theVars = new SimpleDictionary<string, string>();
            theContext = new ScriptContext("1", "Name", CancellationToken.None, theLocator, theVars);

            theLocator.Add<IGameState>(theGameState);
        }