예제 #1
0
        public void AssetStoreTest(string dt, DepreciationMethod type)
        {
            var asset1 = AssetDataProvider.Create(dt, type);

            foreach (var item in asset1.Schedule)
            {
                item.Value = 0;
                if (item is DevalueItem dev)
                {
                    dev.Amount = 0;
                }
            }

            m_Adapter.Upsert(asset1);
            Assert.NotNull(asset1.ID);

            var asset2 = m_Adapter.SelectAssets(DistributedQueryUnconstrained.Instance).Single();

            Assert.Equal(asset1, asset2, new AssetEqualityComparer());

            var asset3 = m_Adapter.SelectAsset(asset1.ID.Value);

            Assert.Equal(asset1, asset3, new AssetEqualityComparer());

            Assert.True(m_Adapter.DeleteAsset(asset1.ID.Value));
            Assert.False(m_Adapter.DeleteAsset(asset1.ID.Value));

            Assert.False(m_Adapter.SelectAssets(DistributedQueryUnconstrained.Instance).Any());
        }
예제 #2
0
        public virtual void AssetTest(string dt, DepreciationMethod type)
        {
            var asset1 = AssetDataProvider.Create(dt, type);
            var asset2 = Serializer.ParseAsset(Serializer.PresentAsset(asset1));

            Assert.Equal(asset1, asset2, new AssetEqualityComparer());
        }