diff --git a/Sinvo.EplanHpD.Plugin.Test/CheckTest.cs b/Sinvo.EplanHpD.Plugin.Test/CheckTest.cs index 1662d0d..395c4f8 100644 --- a/Sinvo.EplanHpD.Plugin.Test/CheckTest.cs +++ b/Sinvo.EplanHpD.Plugin.Test/CheckTest.cs @@ -2,6 +2,7 @@ using Sinvo.EplanHpD.Plugin.WPFUI.Models; using Sinvo.EplanHpD.Plugin.WPFUI.ViewModel; using System.Collections.Generic; +using System.Linq; namespace Sinvo.EplanHpD.Plugin.Test { @@ -74,9 +75,87 @@ namespace Sinvo.EplanHpD.Plugin.Test WireNumber= "L1CP528", } }); + } + [TestMethod("检查所有项时是否有异常")] + public void CheckAllErrorTest() + { + var vm = new MainViewModel(); + var datas = new List + { + new StuffedDataModel + { + CheckedMsg= null, + CrossSection= "1.5", + DiscolorationDesc= "V-1.5-CE(褐色)/定制", + ErrorCount= 0, + FrontStripLength= "5.2 mm", + FrontTerminalMaterialCode= "42020100000382", + FrontTerminalModel= "C45-1.5-CE/定制", + Imprint= "L1CP527", + Insulation= new InsulationModel(), + IsChecked= false, + IsError= false, + IsIgnore= false, + Model= "RV-BK-1x1.5-1224-16×N2-L1CP528", + NumberTubeContent= "白色号码管φ6/定制", + NumberTubeMaterialNo= "42020100000249", + NumberTubeSpec= "白色号码管φ6/定制", + Quantity= 1, + RearStripLength= "8 mm", + RearTerminalMaterialCode= "42020100000427", + RearTerminalModel= "SNB2-4-CE/定制", + WireCode= "42020100000188", + WireColor= "BK", + WireLength= "1224", + WireModel= "黑色RV1.5/定制", + WireName= "w_00931", + WireNumber= "L1CP528", + + }, + new StuffedDataModel + { + CheckedMsg= null, + CrossSection= "1.5", + DiscolorationDesc= "V-6-CE(绿色)/定制", + ErrorCount= 0, + FrontStripLength= "5.2 mm", + FrontTerminalMaterialCode= "42020100000920", + FrontTerminalModel= "RNB5.5-6-CE/定制", + Imprint= "L1CP528", + Insulation= new InsulationModel + { + Specification = "V-6-CE(绿色)/定制", + MaterialCode = "42013500000438", + + }, + IsChecked= false, + IsError= false, + IsIgnore= false, + Model= "RV-BK-1x1.5-1224-16×N2-L1CP528", + NumberTubeContent= "白色号码管φ6/定制", + NumberTubeMaterialNo= "42020100000249", + NumberTubeSpec= "白色号码管φ6/定制", + Quantity= 1, + RearStripLength= "8 mm", + RearTerminalMaterialCode= "42020100000605", + RearTerminalModel= "C45-6-CE/定制", + WireCode= "42020100000513", + WireColor= "BK", + WireLength= "1224", + WireModel= "橙色RV6.0-CE/定制", + WireName= "w_00931", + WireNumber= "L1CP528", + + } + }; + vm.CheckAll(datas); + Assert.IsTrue(datas.First(it => it.Imprint == "L1CP527").IsError); + Assert.IsFalse(datas.First(it => it.Imprint == "L1CP528").IsError); + } + [TestMethod("检查包括D-PE的线")] public void CheckAllWithDPETest() { @@ -96,7 +175,6 @@ namespace Sinvo.EplanHpD.Plugin.Test Insulation= new InsulationModel() { Specification = "V-1.5-CE(褐色)/定制", - }, IsChecked= false, IsError= false, diff --git a/Sinvo.EplanHpD.Plugin.Test/StuffTest.cs b/Sinvo.EplanHpD.Plugin.Test/StuffTest.cs index 64a4176..8d25990 100644 --- a/Sinvo.EplanHpD.Plugin.Test/StuffTest.cs +++ b/Sinvo.EplanHpD.Plugin.Test/StuffTest.cs @@ -105,7 +105,6 @@ Project = "放卷2", [TestMethod("号码管处理测试")] public void StuffedNameTubeTest() { - var vm = new MainViewModel(); var result = vm.StuffData(new List { @@ -117,15 +116,14 @@ Project = "放卷2", */ new ReportModel - { - Imprint="D-PE", - PartNumber = "黑色RV10.0/定制", - CoreDiameter = "16 mm2", - Length = "5841.1 mm", - DisplayColor = "黄色", - DisplayStripeColor = "绿色" - } - + { + Imprint="D-PE", + PartNumber = "黑色RV10.0/定制", + CoreDiameter = "16 mm2", + Length = "5841.1 mm", + DisplayColor = "黄色", + DisplayStripeColor = "绿色" + } }).Result; //Assert.IsTrue(result.Count == 4); //Assert.IsTrue(result.Where(it => it.Imprint == "EC5L1").First().WireColor == "LBU");