public async void TestTreeIndex(string request) { var controller = new TreeController(); var result = (await controller.Get(request)).Value; Assert.True(BalanceExample.IsAvl(result)); }
public void TestHomeIndex(string tree) { var homeController = new HomeController(); var parseModel = new ParseModel { TreeRequest = tree }; var result = homeController.Index(parseModel) as ViewResult; parseModel = result?.Model as ParseModel; if (parseModel != null) { var node = NodeSerializer.Deserialize(parseModel.TreeResultJson); node = BalanceExample.Balance(node); Assert.True(BalanceExample.IsAvl(node)); } else { throw new Exception("Error"); } }