示例#1
0
        public void WriterStringSelectTest()
        {
            var m11   = new MonadPrimus.Writer <int>(1, "init1");
            var m12   = m11.Select(x => x.ToString() + "2");
            var res11 = m12.RunWriter();

            Assert.AreEqual("12", res11.Value);
            Assert.AreEqual("init1", res11.State);
        }
示例#2
0
        public void WriterSelectTest()
        {
            var m11   = new MonadPrimus.Writer <string, int>(1, new string[] { "init1", "init2" });
            var m12   = m11.Select(x => x.ToString() + "2");
            var res11 = m12.RunWriter();

            Assert.AreEqual("12", res11.Value);
            Assert.AreEqual("init1", res11.State.ElementAt(0));
            Assert.AreEqual("init2", res11.State.ElementAt(1));
            Assert.AreEqual(2, res11.State.Count());
        }