Exemple #1
0
        public void TryAdd_Should_ReturnFalse_When_NotSubtractableValue()
        {
            const double baseValue = 12;
            var          value     = new StructStub();

            Assert.False(CalculateUtilities.TryAdd(baseValue, value, out _));
        }
Exemple #2
0
        public void TryAdd_Should_ReturnFalse_When_NotSubtractableBase()
        {
            const int    baseValue = 12;
            const double value     = 1;

            Assert.False(CalculateUtilities.TryAdd(baseValue, value, out _));
        }
Exemple #3
0
        public void TryAdd_Should_ReturnTrue()
        {
            var baseValue = new DateTime(2018, 1, 1, 12, 30, 45).ToLocalTime();
            var value     = TimeSpan.FromDays(1);

            Assert.True(CalculateUtilities.TryAdd(baseValue, value, out var _result));
            Assert.Equal(new DateTime(2018, 1, 2, 12, 30, 45).ToLocalTime(), _result);
        }