CFGLibTest.Unit.TestCFGToCNFEmptyProb.TestGetNullable02 C# (CSharp) Method

TestGetNullable02() private method

private TestGetNullable02 ( ) : void
return void
		public void TestGetNullable02() {
			var productions = new HashSet<Production> {
				CFGParser.Production("<A> -> <A> <B>"),
				CFGParser.Production("<A> -> ε"),
				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(2.0 / 3.0, result[Nonterminal.Of("A")]);
			Helpers.AssertNear(0.5, result[Nonterminal.Of("B")]);
		}