public void FromResolvesToSelf()
        {
            var sut     = new ItemSlotBuilders();
            var builder = sut.From(ItemSlot.Amulet);

            var actual = builder.Resolve(BuildersHelper.MockResolveContext());

            Assert.AreEqual(builder, actual);
        }
Exemple #2
0
        public void ResolveUsesInjectedFunction()
        {
            var expected = 5;
            var sut      = CreateSut(expected);

            var actual = sut.Resolve(BuildersHelper.MockResolveContext());

            Assert.AreEqual(expected, actual);
        }
        public void AddResolveBuildsToCorrectValue(double?leftValue, double?rightValue)
        {
            var expected = ((NodeValue?)leftValue).SumWhereNotNull((NodeValue?)rightValue);
            var context  = BuildersHelper.MockResolveContext();
            var right    = Mock.Of <IValueBuilder>(b => b.Resolve(context) == new ValueBuilderImpl(rightValue));
            var sut      = CreateSut(leftValue);

            var resolved = sut.Add(right).Resolve(context);
            var actual   = resolved.Build().Calculate(null);

            Assert.AreEqual(expected, actual);
        }
Exemple #4
0
        public void AddResolveBuildsToCorrectValue(double?leftValue, double?rightValue)
        {
            var expected = (NodeValue?)new[] { leftValue, rightValue }.AggregateOnValues((l, r) => l + r);
            var context = BuildersHelper.MockResolveContext();
            var right   = Mock.Of <IValueBuilder>(b => b.Resolve(context) == new ValueBuilderImpl(rightValue));
            var sut     = CreateSut(leftValue);

            var resolved = sut.Add(right).Resolve(context);
            var actual   = resolved.Build().Calculate(null);

            Assert.AreEqual(expected, actual);
        }