コード例 #1
0
        public void ObjectInitializers()
        {
            var myDinner = new Dinner()
            {
                MainCourse = "Tacos",
                Drinks     = "Beer",
                Desert     = "Another Beer"
            };

            //myDinner.MainCourse = "Tacos";
            //myDinner.Drinks = "Beer";
            //myDinner.HasSides = false;
            //myDinner.Desert = "Another Beer";

            Assert.Equal("For Dinner you will have Tacos With Another Beer",
                         myDinner.GetPlan());
        }
 public void MessWithIt(Dinner x)
 {
     x.MainCourse = "McDonalds";
 }
コード例 #3
0
 public void MessWithIt(Dinner x)
 {
     x.MainCourse = "Tacos";
 }