Exemplo n.º 1
0
    public void MultipleNullColumnsResultsNonNullKey()
    {
        var values = new SlimRow();
        var result = values.GenerateKey("id", "name");

        Assert.IsNotNull(result);
    }
Exemplo n.º 2
0
    public void SingleNullColumnResultsNullKey()
    {
        var values = new SlimRow();
        var result = values.GenerateKey("name");

        Assert.IsNull(result);
    }
Exemplo n.º 3
0
    public void TimeSpanKeyIsInvariantWithDaysAndMilliseconds()
    {
        var values = new SlimRow()
        {
            ["time"] = new TimeSpan(1, 1, 0),
        };

        var result = values.GenerateKey("time");

        Assert.AreEqual("0:01:01:00.0000000", result);
    }
Exemplo n.º 4
0
    public void DateTimeOffsetKeyIsInvariantWithMilliseconds()
    {
        var values = new SlimRow()
        {
            ["dto"] = new DateTimeOffset(2020, 02, 20, 12, 12, 0, 666, new TimeSpan(2, 0, 0)),
        };

        var result = values.GenerateKey("dto");

        Assert.AreEqual("2020.02.20 12:12:00.6660000 +02:00", result);
    }
Exemplo n.º 5
0
    public void DateTimeKeyIsInvariantWithMilliseconds()
    {
        var values = new SlimRow()
        {
            ["date"] = new DateTime(2020, 02, 20, 12, 12, 0, 666),
        };

        var result = values.GenerateKey("date");

        Assert.AreEqual("2020.02.20 12:12:00.6660000", result);
    }
Exemplo n.º 6
0
    public void IntKeyIsInvariant()
    {
        var values = new SlimRow()
        {
            ["id"]   = 1234567,
            ["date"] = new DateTime(2020, 02, 20, 12, 12, 0, 666),
        };

        var result = values.GenerateKey("id", "date");

        Assert.IsTrue(result.Contains("1234567", StringComparison.Ordinal));
        Assert.IsTrue(result.Contains("2020.02.20 12:12:00.6660000", StringComparison.Ordinal));
    }