Ejemplo n.º 1
0
    public void ValidateAdditionFunctions_WithNegativeValues(string timeUnitvalueToAdd, string unit, long valueToAdd, string result)
    {
        TimeUnit a = new TimeUnit(timeUnitvalueToAdd);
        TimeUnit b;

        switch (unit)
        {
        case "m":
            b = a.AddMinutes(valueToAdd);
            break;

        case "d":
            b = a.AddDays(valueToAdd);
            break;

        case "w":
            b = a.AddWeeks(valueToAdd);
            break;

        case "h":
            b = a.AddHours(valueToAdd);
            break;

        case "s":
            b = a.AddSeconds(valueToAdd);
            break;

        case "S":
            b = a.AddMilliseconds(valueToAdd);
            break;

        default:
            b = a.AddSeconds(valueToAdd);
            break;
        }
        Assert.AreEqual(result, b.Value);
    }