示例#1
0
        private void MainView_Loaded(object sender, RoutedEventArgs e)
        {
            viewmodel = (MainViewModel)this.DataContext;
            Products  = viewmodel.Products;
            Products1 = viewmodel.Products1;
            Products2 = viewmodel.Products2;

            Product2 tmp = new Product2()
            {
                Chk1     = true,
                BandWide = "200",
                Chk2     = false,
                Freq     = "200000"
            };

            tmp.ToString();
            // Products.CollectionChanged += Products_CollectionChanged;


            Product3 tmpProduct3 = new Product3()
            {
                IsMine = true, Chk1 = true, BandWide = "100", Chk2 = true, Freq = "200"
            };
            var tmpStruct = tmpProduct3.InputStruct <StTest01>();

            //StTest01 st = new StTest01();
            //var tmpType = st.GetType();
            //var tmpProperty = st.GetType().GetMembers();
            //foreach (var p in st.GetType().GetProperties())
            //{
            //    // System.Diagnostics.Debug.WriteLine(p.Name + " : ");
            //}
        }
示例#2
0
        public void CreateNewOrderNotifyWhenProductHaveInvalidQuantity()
        {
            var purchaseOrderBuilder = PurchaseOrder.New(LocalNotification)
                                       .UpdatePriceTable(PriceTable)
                                       .WithCustomer(Guid.NewGuid())
                                       .WithDiscount(0)
                                       .AddPurchaseOrderLines(lines =>
            {
                lines.AddProduct(Product1, 0);
                lines.AddProduct(Product2, 0);
            });

            var pucharseOrder = purchaseOrderBuilder.Build();

            Assert.NotEmpty(LocalNotification.GetAll());

            Assert.Contains(LocalNotification.GetAll(), a => a.DetailedMessage == PurchaseOrder.Error.PurchaseOrderLineMustHaveValidQuantity.ToString());
            Assert.Contains(LocalNotification.GetAll(), a => a.Message.Contains(Product1.ToString()));
            Assert.Contains(LocalNotification.GetAll(), a => a.Message.Contains(Product2.ToString()));
        }