Пример #1
0
 public void Add_Parameter()
 {
     var collection = new BigqueryParameterCollection();
     var parameter = new BigqueryParameter();
     var added = collection.Add(parameter);
     Assert.Same(parameter, added);
     Assert.Same(parameter, collection[0]);
 }
Пример #2
0
 public void Add_Parameterless()
 {
     var collection = new BigqueryParameterCollection();
     var parameter = collection.Add();
     Assert.Same(parameter, collection[0]);
     Assert.Null(parameter.Name);
     Assert.Null(parameter.Type);
     Assert.Null(parameter.Value);
 }
Пример #3
0
 public void Add_NameAndType()
 {
     var collection = new BigqueryParameterCollection();
     var parameter = collection.Add("name", BigqueryParameterType.Date);
     Assert.Same(parameter, collection[0]);
     Assert.Equal("name", parameter.Name);
     Assert.Equal(BigqueryParameterType.Date, parameter.Type);
     Assert.Null(parameter.Value);
 }
Пример #4
0
 public void Add_TypeValue()
 {
     var collection = new BigqueryParameterCollection();
     var value = DateTime.UtcNow;
     var parameter = collection.Add(BigqueryParameterType.Date, value);
     Assert.Same(parameter, collection[0]);
     Assert.Null(parameter.Name);
     Assert.Equal(BigqueryParameterType.Date, parameter.Type);
     Assert.Equal(value, parameter.Value);
 }
Пример #5
0
        public void ListMemberDelegation()
        {
            var p1 = new BigqueryParameter();
            var p2 = new BigqueryParameter();
            var collection = new BigqueryParameterCollection { p1, p2 };
            Assert.Equal(new[] { p1, p2 }, collection);
            Assert.Same(p1, collection[0]);
            Assert.Same(p2, collection[1]);
            Assert.Equal(2, collection.Count);

            collection.Clear();
            Assert.Equal(0, collection.Count);
        }