예제 #1
0
    public void From_Null_Or_Empty_String_Returns_Zeroes(string input)
    {
        // Arrange

        // Act
        var result = new DateTimeInt(input);

        // Assert
        Assert.Equal("000000000000", result.ToString());
    }
예제 #2
0
    public void From_Integers_Sets_Values()
    {
        // Arrange
        const string expected = "200001020304";

        // Act
        var result = new DateTimeInt(2000, 1, 2, 3, 4);

        // Assert
        Assert.Equal(expected, result.ToString());
    }
예제 #3
0
    public void From_Valid_Long_Sets_Values()
    {
        // Arrange
        const long input = 200001020304;

        // Act
        var result = new DateTimeInt(input);

        // Assert
        Assert.Equal(input.ToString(), result.ToString());
    }
예제 #4
0
    public void Valid_Returns_String_Value()
    {
        // Arrange
        const string expected = "200001020304";
        var          input    = new DateTimeInt(expected);

        // Act
        var result = input.ToString();

        // Assert
        Assert.Equal(expected, result);
    }
예제 #5
0
#pragma warning disable xUnit1026 // Theory methods should use all of their parameters
    public void Invalid_Returns_Zeroes(int year, int month, int day, int hour, int minute, string _)
#pragma warning restore xUnit1026 // Theory methods should use all of their parameters
    {
        // Arrange
        var input = new DateTimeInt(year, month, day, hour, minute);

        // Act
        var result = input.ToString();

        // Assert
        Assert.Equal("000000000000", result);
    }