private void dodajocene_Click(object sender, RoutedEventArgs e) { try { Uzytkownik usr = (Uzytkownik)uczen.SelectedItem; KeyValuePair <int, string> przedmiotv = (KeyValuePair <int, string>)przedmiot.SelectedValue; int ocenav = ocena.SelectedIndex + 1; string datav = data.SelectedDate.Value.ToShortDateString(); DBhelp.Dodajocene(usr.id, przedmiotv.Key, ocenav, datav); } catch (NullReferenceException exception) { } }
public void DodajoceneTest() { int test_reader = 3; Assert.IsTrue(test_reader == DBhelp.Dodajocene(2, 8, 5, "2019-02-10") + DBhelp.Dodajocene(4, 6, 4, "2019-02-10") + DBhelp.Dodajocene(7, 3, 5, "2019-02-09")); }