示例#1
0
 public void IsoMorphismHasUniqueInverse()
 {
     Assert.Throws <ArgumentException>(() => Morphism.CreateIso(
                                           Product2.Create(1, true),
                                           Product2.Create(2, true)
                                           ));
 }
示例#2
0
        public void IsoMorphism()
        {
            var m = Morphism.CreateIso(
                Product2.Create(0, false),
                Product2.Create(1, true)
                );

            Assert.Equal(false.ToOption(), m.Apply(0));
            Assert.Equal(true.ToOption(), m.Apply(1));

            Assert.Equal(0.ToOption(), m.Inverse.Apply(false));
            Assert.Equal(1.ToOption(), m.Inverse.Apply(true));
        }