public void Clear()
    {
        foreach (var testCase in UnitIconImageCacheTestCase.GetAtlas)
        {
            var registerAtlases = (List <UnitIconImageCacheTestCase.AtlasCache>)testCase.Arguments[0];

            var cache = new UnitIconImageCache();

            foreach (var registerAtlas in registerAtlases)
            {
                cache.Register(registerAtlas.key, registerAtlas.atlas);
            }

            cache.Clear();

            foreach (var registerAtlas in registerAtlases)
            {
                var result = cache.GetAtlas(registerAtlas.key);
                Assert.True(result == null);
            }

            break;
        }

        foreach (var testCase in UnitIconImageCacheTestCase.GetSprite)
        {
            UnitIconImageCacheTestCase.InitializeSprites();

            var registerSprites = (List <UnitIconImageCacheTestCase.SpriteCache>)testCase.Arguments[0];

            var cache = new UnitIconImageCache();

            foreach (var registerSprite in registerSprites)
            {
                cache.Register(registerSprite.key, registerSprite.sprite);
            }

            cache.Clear();

            foreach (var registerSprite in registerSprites)
            {
                var result = cache.GetSprite(registerSprite.key);
                Assert.True(result == null);
            }

            break;
        }
    }
    public void GetSprite()
    {
        foreach (var testCase in UnitIconImageCacheTestCase.GetSprite)
        {
            UnitIconImageCacheTestCase.InitializeSprites();

            var registerSprites = (List <UnitIconImageCacheTestCase.SpriteCache>)testCase.Arguments[0];
            var removeSprites   = (List <string>)testCase.Arguments[1];
            var argKey          = (string)testCase.Arguments[2];
            var expected        = (Sprite)testCase.Arguments[3];

            var cache = new UnitIconImageCache();

            foreach (var registerSprite in registerSprites)
            {
                cache.Register(registerSprite.key, registerSprite.sprite);
            }

            foreach (var removeSpriteName in removeSprites)
            {
                cache.RemoveSprite(removeSpriteName);
            }

            var result = cache.GetSprite(argKey);

            if (expected == null)
            {
                Assert.True(result == null, "Failed at " + testCase.TestName);
            }
            else
            {
                Assert.True(
                    result != null &&
                    result == expected
                    , "Failed at " + testCase.TestName);
            }
        }
    }