Exemplo n.º 1
0
        //Not implemented [Theory, AutoData]
        public void Should_be_able_to_use_coalesce_in_expression(IEnumerable <Customer> myclasses)
        {
            var models    = new AllOurCustomers(null, null);
            var newModels = models.With(o => o.MyClasses ?? myclasses);

            Assert.Equal(myclasses, newModels.MyClasses);
        }
Exemplo n.º 2
0
        public void Should_be_able_to_use_invoke_in_expression(AllOurCustomers models, IEnumerable <Customer> myclasses)
        {
            Func <Customer> getMyClass = () => myclasses.First();
            var             newModels  = models.With(o => o.MyClasses.Add(getMyClass()));

            Assert.Equal(getMyClass(), newModels.MyClasses.Last());
        }
Exemplo n.º 3
0
        public void Should_be_able_to_set_enumerable_on_model_with_empty_constructor(
            AllOurCustomers models)
        {
            var myClass = new Customer(-1, string.Empty, new string[0]);
            var ret     = models.With(m => m.MyClasses.Add(myClass));

            Assert.Equal(myClass, ret.MyClasses.First());
        }
Exemplo n.º 4
0
 public void Should_be_able_to_use_invoke_in_expression(AllOurCustomers models, IEnumerable<Customer> myclasses)
 {
     Func<Customer> getMyClass = () => myclasses.First();
     var newModels = models.With(o => o.MyClasses.Add(getMyClass()));
     Assert.Equal(getMyClass(), newModels.MyClasses.Last());
 }
Exemplo n.º 5
0
 //Not implemented [Theory, AutoData]
 public void Should_be_able_to_use_coalesce_in_expression(IEnumerable<Customer> myclasses)
 {
     var models = new AllOurCustomers(null, null);
     var newModels = models.With(o => o.MyClasses ?? myclasses);
     Assert.Equal(myclasses, newModels.MyClasses);
 }
Exemplo n.º 6
0
 public void Should_be_able_to_use_call_in_expression(AllOurCustomers models, IEnumerable<Customer> myclasses)
 {
     var newModels = models.With(o => o.MyClasses.Add(myclasses.First()));
     Assert.Equal(myclasses.First(), newModels.MyClasses.Last());
 }
Exemplo n.º 7
0
 public void Should_be_able_to_set_enumerable_with_new(AllOurCustomers models)
 {
     var ret = models.With(m => m.MyClasses.Add(new Customer(-1, string.Empty, new string[0])));
     Assert.Equal(-1, ret.MyClasses.First().Id);
 }
Exemplo n.º 8
0
 public void Should_be_able_to_set_enumerable_on_model_with_empty_constructor(
     AllOurCustomers models)
 {
     var myClass = new Customer(-1, string.Empty, new string[0]);
     var ret = models.With(m => m.MyClasses.Add(myClass));
     Assert.Equal(myClass, ret.MyClasses.First());
 }
Exemplo n.º 9
0
        public void Should_be_able_to_use_call_in_expression(AllOurCustomers models, IEnumerable <Customer> myclasses)
        {
            var newModels = models.With(o => o.MyClasses.Add(myclasses.First()));

            Assert.Equal(myclasses.First(), newModels.MyClasses.Last());
        }
Exemplo n.º 10
0
        public void Should_be_able_to_set_enumerable_with_new(AllOurCustomers models)
        {
            var ret = models.With(m => m.MyClasses.Add(new Customer(-1, string.Empty, new string[0])));

            Assert.Equal(-1, ret.MyClasses.First().Id);
        }