Exemplo n.º 1
0
        public void Result_marked_immutable_not_cloned()
        {
            var result  = new MyImmutable();
            var result2 = ApplyStrategy(result, new object());

            Assert.AreEqual(result, result2);
        }
Exemplo n.º 2
0
    // modify this method as shown
    public MyImmutable Apply(Func <decimal, decimal, decimal> aggFunc, MyImmutable y)
    {
        var aggregated = new Dictionary <ImmutableKey, decimal>(AllKeys.Count());

        foreach (ImmutableKey bt in AllKeys)
        {
            aggregated[bt] = aggFunc(this[bt], y[bt]);
        }
        return(GetNew(aggregated));
    }
Exemplo n.º 3
0
        public void ImmutableFromContent()
        {
            var node = new ConstructionNode(typeof(MyImmutable))
            {
                InjectableArguments = new[] { "Hola" }
            };
            var myImmutable = new MyImmutable("Hola");
            var fixture     = Create(node);

            Assert.Equal(myImmutable, fixture.Result);
        }
Exemplo n.º 4
0
 protected bool Equals(MyImmutable other)
 {
     return(string.Equals(arg, other.arg));
 }