示例#1
0
 def test_add_shouldTaint(self):
     component_under_test = Dauerauftraege()
     assert component_under_test.taint_number() == 0
     component_under_test.add(datum('1.1.2010'), date.today(),
                              'some kategorie', 'some name',
                              'some rhythmus', 1.23)
     assert component_under_test.taint_number() == 1
示例#2
0
    def test_get_future_withActualDauerauftrag_shouldReturnEmptyList(self):
        component_under_test = Dauerauftraege()
        component_under_test.add(datum('01.01.2012'), datum('01.01.2100'),
                                 'some kategorie', 'some name',
                                 'some rhythmus', 1)

        result = component_under_test.future()

        assert result == []
示例#3
0
 def test_edit_shouldTaint(self):
     component_under_test = Dauerauftraege()
     component_under_test.add(datum('1.1.2010'), date.today(),
                              'some kategorie', 'some name',
                              'some rhythmus', 1.23)
     component_under_test.de_taint()
     assert component_under_test.taint_number() == 0
     component_under_test.edit(0, datum('2.1.2010'), datum('3.1.2010'),
                               'some other kategorie', 'some other name',
                               'some other rhythmus', 2.34)
     assert component_under_test.taint_number() == 1
示例#4
0
    def test_add(self):
        component_under_test = Dauerauftraege()
        component_under_test.add(datum('1.1.2010'), date.today(),
                                 'some kategorie', 'some name',
                                 'some rhythmus', 1.23)

        assert len(component_under_test.content) == 1
        assert component_under_test.content.Startdatum[0] == datum('1.1.2010')
        assert component_under_test.content.Endedatum[0] == date.today()
        assert component_under_test.content.Name[0] == 'some name'
        assert component_under_test.content.Kategorie[0] == 'some kategorie'
        assert component_under_test.content.Rhythmus[0] == 'some rhythmus'
        assert component_under_test.content.Wert[0] == 1.23
示例#5
0
    def test_get(self):
        component_under_test = Dauerauftraege()
        component_under_test.add(datum('1.1.2010'), date.today(),
                                 'some kategorie', 'some name',
                                 'some rhythmus', 1.23)

        result = component_under_test.get(0)

        assert len(component_under_test.content) == 1
        assert result['Startdatum'] == datum('1.1.2010')
        assert result['Endedatum'] == date.today()
        assert result['Name'] == 'some name'
        assert result['Kategorie'] == 'some kategorie'
        assert result['Rhythmus'] == 'some rhythmus'
        assert result['Wert'] == 1.23
示例#6
0
    def test_get_future_withFutureDauerauftrag_shouldReturnDauerauftrag(self):
        component_under_test = Dauerauftraege()
        component_under_test.add(datum('01.01.2100'), datum('01.01.2100'),
                                 'some kategorie', 'some name',
                                 'some rhythmus', 1)

        result = component_under_test.future()

        assert len(result) == 1
        assert result[0]['Startdatum'] == datum('01.01.2100')
        assert result[0]['Endedatum'] == datum('01.01.2100')
        assert result[0]['Kategorie'] == 'some kategorie'
        assert result[0]['Name'] == 'some name'
        assert result[0]['Rhythmus'] == 'some rhythmus'
        assert result[0]['Wert'] == 1
示例#7
0
    def test_aendere_beiLeererDatenbank(self):
        component_under_test = Dauerauftraege()
        component_under_test.add(datum('1.1.2010'), date.today(),
                                 'some kategorie', 'some name',
                                 'some rhythmus', 1.23)
        component_under_test.edit(0, datum('2.1.2010'), datum('3.1.2010'),
                                  'some other kategorie', 'some other name',
                                  'some other rhythmus', 2.34)

        assert len(component_under_test.content) == 1
        assert component_under_test.content.Startdatum[0] == datum('2.1.2010')
        assert component_under_test.content.Endedatum[0] == datum('3.1.2010')
        assert component_under_test.content.Name[0] == 'some other name'
        assert component_under_test.content.Kategorie[
            0] == 'some other kategorie'
        assert component_under_test.content.Rhythmus[
            0] == 'some other rhythmus'
        assert component_under_test.content.Wert[0] == 2.34