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)); }
public void IsStringTypeMonoid() { Assert.True(MonoidLaws.HasIdentity <StringType, string>("test")); Assert.True(MonoidLaws.IsAssociative <StringType, string>("a", "b", "c")); }
public void IsIntTypeMonoid() { Assert.True(MonoidLaws.HasIdentity <IntType, int>(1)); Assert.True(MonoidLaws.IsAssociative <IntType, int>(1, 11, 111)); }