コード例 #1
0
        public void IsSeqTypeMonoid()
        {
            var comparer = EnumerableEqualityComparer <int> .Instance;

            Assert.True(MonoidLaws.HasIdentity <SeqType <int>, IEnumerable <int> >(Enumerable.Range(0, 2), comparer));
            Assert.True(MonoidLaws.IsAssociative <SeqType <int>, IEnumerable <int> >(new[] { 1, 2 }, new[] { 3 }, new[] { 4, 5 }, comparer));
        }
コード例 #2
0
 public void IsStringTypeMonoid()
 {
     Assert.True(MonoidLaws.HasIdentity <StringType, string>("test"));
     Assert.True(MonoidLaws.IsAssociative <StringType, string>("a", "b", "c"));
 }
コード例 #3
0
 public void IsIntTypeMonoid()
 {
     Assert.True(MonoidLaws.HasIdentity <IntType, int>(1));
     Assert.True(MonoidLaws.IsAssociative <IntType, int>(1, 11, 111));
 }