public void Test0() { var tokenizer = new GLUniformBlockNameParser(); var token = tokenizer.Parse("CAMERA[0]"); Assert.IsNotNull(token); Assert.AreEqual("CAMERA", token.Prefix); Assert.AreEqual(0, token.X); Assert.AreEqual(0, token.Y); Assert.AreEqual(0, token.Z); }
public void Test4() { var tokenizer = new GLUniformBlockNameParser(); var token = tokenizer.Parse("UBO[1][4]"); Assert.IsNotNull(token); Assert.AreEqual("UBO", token.Prefix); Assert.AreEqual(1, token.X); Assert.AreEqual(4, token.Y); Assert.AreEqual(0, token.Z); }
public void TestCase() { IGLUniformBlockNameParser tokenizer = new GLUniformBlockNameParser(); var token0 = tokenizer.Parse("UBO[0]"); token0.BindingIndex = 10; var collator = new GLUniformBlockGroupCollator(); collator.Add(token0); var token1 = tokenizer.Parse("UBO[1]"); token1.BindingIndex = 10; collator.Add(token1); var groups = collator.Collate(); Assert.AreEqual(1, groups.Values.Count); var firstGroup = groups[10]; Assert.AreEqual("UBO", firstGroup.Prefix); Assert.AreEqual(2, firstGroup.Count); }