public void ReturnResTest_output_list() { // Arrange var resourses = new GetResourse(); var repository = new Mock <RepositoryResourseEF>(); repository.Setup(arg => arg.GetAll()).Returns(new List <Resourse>()); resourses.resourse = repository.Object; // Act var resultCollection = resourses.ReturnResourse(); // Assert Assert.IsNotNull(resultCollection); }
public MainWindow() { InitializeComponent(); context = new ResourseContext(); db = new RepositoryResourseEF(context); db.db.Resourses.Load(); getRes = new GetResourse(); // context.Resourses.Load(); // ResourseGrid.ItemsSource = context.Resourses.Local.ToBindingList(); ResourseGrid.ItemsSource = getRes.ReturnResourse().ToList(); this.Closing += MainWindow_Closing; }
private void UPDATE() { // ResourseGrid.ItemsSource = db.db.Resourses.Local.ToBindingList(); ResourseGrid.ItemsSource = getRes.ReturnResourse().ToList(); }
private void updateButton_Click(object sender, RoutedEventArgs e) { //context.Resourses.Load(); ResourseGrid.ItemsSource = getRes.ReturnResourse().ToList(); db.Save(); }