Ejemplo n.º 1
0
    public void AddView()
    {
        var context = new Contexts();

        var gameEntity = CharacterFactoryTestHelper.CreateCharacterView(context);

        Assert.IsTrue(gameEntity.hasAsset);
        Assert.IsTrue(gameEntity.hasViewController);
    }
Ejemplo n.º 2
0
    public void DestroyView()
    {
        var context = new Contexts();

        var destroySystem = (ICleanupSystem)new DestroySystem(context);

        var character = CharacterFactoryTestHelper.CreateCharacterView(context);

        character.isDestroy = true;

        destroySystem.Cleanup();

        Assert.IsTrue(context.game.count == 0); 
    }
Ejemplo n.º 3
0
    public void Create()
    {
        var context = new Contexts();

        var character = CharacterFactoryTestHelper.CreateCharacterView(context);

        Assert.IsTrue(character.hasViewController);

        var views = character.viewController.controller.GetViews();

        Assert.IsTrue(views.OfType <CharacterViewController>().Count() == 1);
        Assert.IsTrue(views.OfType <PushViewController>().Count() == 1);
        Assert.IsTrue(views.OfType <RiseViewController>().Count() == 1);
        Assert.IsTrue(views.OfType <SpriteViewController>().Count() == 1);

        Assert.IsTrue(views.Length == 4);
    }