/// <summary> /// Construtor /// </summary> public HomeController() { if (_context == null) { _context = new GiHubContext(); } }
public void GetRepositoriesAzure() { // Arrange var context = new GiHubContext(); Assert.IsTrue(context.Repositories.Any()); foreach (var repository in context.Repositories) { Debug.WriteLine("Id : {0}", repository.Id); } }
public void SaveRepositorys() { // Arrange HomeController controller = new HomeController(); // Act GiHubContext context = new GiHubContext(); context.Database.CreateIfNotExists(); context.Repositories.Add(new RepositoryGitHub { Name = "repo", Created = DateTimeOffset.Now, CloneUrl = "url/test", Description = "Description 123", ForksCount = 1, HtmlUrl = "url/test2222" }); context.SaveChanges(); }