public void TestDBComparerProcedure(RegexFoundingUnitTest param) { // Arrange var e = RegexFounding.List.First(x => x.Action == param.SqlActionId && x.ApplyOn == param.SqlWhatId); Bloc expected = new Bloc() { ScriptId = 0, SqlActionId = param.SqlActionId, TypeObjectId = param.SqlWhatId, }; // Act var ba = new BlocAnalyzer(); ba.Analyze(e, 0, param.Text); // Assert Assert.NotNull(ba.Blocs); if (param.Result) { Assert.Single(ba.Blocs); Assert.Collection(ba.Blocs, b => Assert.Equal(expected, b)); } else { Assert.Empty(ba.Blocs); } }
public static IEnumerable <object[]> Jeu2TestFile() { var tests = RegexFoundingUnitTest.Load(@"C:\projets\Bdd\VersionDB4\VersionDB4LibUnitTests\Jeux2TestDBComparer.Json").ToList(); foreach (var exp in tests) { yield return(new object[] { exp }); } }
public Form1() { InitializeComponent(); fullFileName = Path.Combine(Application.StartupPath, "Jeux2Test.Json"); datas = RegexFoundingUnitTest.Load(fullFileName).ToList(); isChange = false; lblNo.Visible = false; cbAction.DataSource = SqlAction.List().Where(x => x.SqlActionId > 1).ToList(); cbWhat.DataSource = TypeObject.List().Where(x => x.TypeObjectId >= 0).ToList(); lblInfos.Text = string.Empty; Choix_SelectedIndexChanged(null, null); GereBoutton(); }