Ejemplo n.º 1
0
 /// <summary>
 /// Construtor
 /// </summary>
 public HomeController()
 {
     if (_context == null)
     {
         _context = new GiHubContext();
     }
 }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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();
        }