Exemplo n.º 1
0
 public void ImmutableTest()
 {
     Assert.AreEqual(5, Immutability.Immutable(2));
     Assert.AreEqual(6, Immutability.Immutable(3));
     Assert.AreEqual(-2, Immutability.Immutable(-5));
 }
Exemplo n.º 2
0
 public void PureFunction()
 {
     Assert.AreEqual(20, Immutability.PureFunction(10));
     Assert.AreEqual(20, Immutability.PureFunction(10));
     Assert.AreEqual(Immutability.SimplePureFunction(249), Immutability.PureFunction(249));
 }
Exemplo n.º 3
0
 public void RaceConditionTest()
 {
     Assert.AreEqual(4, Immutability.RaceCondition());
 }
Exemplo n.º 4
0
 public void DirtyFunction()
 {
     Assert.AreEqual(2, Immutability.DirtyFunction(1));
     Assert.AreEqual(3, Immutability.DirtyFunction(1));
 }