예제 #1
0
        public void Test001()
        {
            var ret = new GcmDistributer
            {
                ["A"] = 6,
                ["B"] = 3,
                ["C"] = 1,
            }.ToArray();

            Assert.AreEqual(ret.Length, 6 + 3 + 1);
            var s = string.Join("", ret);

            Assert.AreEqual(s, "ABAABACABA");
        }
예제 #2
0
        public void Test002()
        {
            var gcm = new GcmDistributer
            {
                ["A"] = 3,
                ["B"] = 3,
                ["C"] = 1,
            };

            gcm.Add("A", 2);
            gcm.Add("A", 1);
            var ret = gcm.ToArray();

            Assert.AreEqual(ret.Length, (3 + 2 + 1) + 3 + 1);
            var s = string.Join("", ret);

            Assert.AreEqual(s, "ABAABACABA");
        }