Ejemplo n.º 1
0
def test_enum_get_member():
    """Test access to enum members."""
    from System import DayOfWeek

    assert DayOfWeek.Sunday == DayOfWeek(0)
    assert DayOfWeek.Monday == DayOfWeek(1)
    assert DayOfWeek.Tuesday == DayOfWeek(2)
    assert DayOfWeek.Wednesday == DayOfWeek(3)
    assert DayOfWeek.Thursday == DayOfWeek(4)
    assert DayOfWeek.Friday == DayOfWeek(5)
    assert DayOfWeek.Saturday == DayOfWeek(6)
Ejemplo n.º 2
0
def test_instantiate_enum_fails():
    """Test that instantiation of an enum class fails."""
    from System import DayOfWeek

    with pytest.raises(TypeError):
        _ = DayOfWeek()
Ejemplo n.º 3
0
 def test():
     ob = DayOfWeek()