CFGLibTest.Unit.TestCFGToCNFEmptyProb.TestGetNullable01 C# (CSharp) Méthode

TestGetNullable01() private méthode

private TestGetNullable01 ( ) : void
Résultat void
		public void TestGetNullable01() {
			var productions = new HashSet<Production> {
				CFGParser.Production("<X> -> <B> <B>"),
				CFGParser.Production("<B> -> 'b'"),
				CFGParser.Production("<B> -> ε"),
			};

			var result = (Dictionary<Nonterminal, double>)nullableClass.InvokeStatic("GetNullable", new object[] { productions });

			Assert.IsTrue(result.Count == 2);
			Helpers.AssertNear(0.5, result[Nonterminal.Of("B")]);
			Helpers.AssertNear(0.25, result[Nonterminal.Of("X")]);
		}