示例#1
0
        public void AnonymizePosts_RenderCommodity_HidesCommodityName()
        {
            string    commodityName1 = "comm-name-1";
            string    commodityName2 = "comm-name-2";
            Commodity commodity1     = CommodityPool.Current.FindOrCreate(commodityName1);
            Commodity commodity2     = CommodityPool.Current.FindOrCreate(commodityName2);
            Amount    amount1        = new Amount(10, commodity1);
            Amount    amount2        = new Amount(10, commodity2);

            AnonymizePosts anonymizePosts = new AnonymizePosts(null);

            anonymizePosts.RenderCommodity(amount1);
            anonymizePosts.RenderCommodity(amount2);

            Assert.Equal("A", amount1.Commodity.Symbol);
            Assert.Equal("B", amount2.Commodity.Symbol);

            Assert.Equal(commodityName1, anonymizePosts.CommodityIndexMap.Keys.First().BaseSymbol);
            Assert.Equal(commodityName2, anonymizePosts.CommodityIndexMap.Keys.Last().BaseSymbol);
        }