示例#1
0
 /// <summary>
 /// Construtor
 /// </summary>
 public HomeController()
 {
     if (_context == null)
     {
         _context = new GiHubContext();
     }
 }
示例#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);
            }
        }
示例#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();
        }