经过两天修正,足够稳定,发布0204,希望作为LTS版本
大石头 编写于 2020-02-04 22:44:36
X
using System;
using XCode.Membership;
using Xunit;

namespace XUnitTest.XCode
{
    public class EntityCacheTest
    {
        [Fact]
        public void TestAddRemove()
        {
            var cache = Role.Meta.Cache;
            var count = cache.Entities.Count;

            var r = new Role { Name = "test" };

            cache.Add(r);
            Assert.Equal(count + 1, cache.Entities.Count);

            cache.Remove(r);
            Assert.Equal(count, cache.Entities.Count);
        }
    }
}