public void GetConfQualityRuleChinese() { WSConnection _connection3 = new WSConnection() { Url = "http://dash-aed-tomcat:8585/CAST-Health-Engineering/rest/", Login = "******", Password = "******", IsActive = true, Name = "Default" }; TestUtility.SetCulture("zh-CN"); ICastRepsitory ccontext = new CastRepository(_connection3, null); if ("ABD".Equals(Environment.UserName)) { const string cdomainHref = "AAD/quality-indicators/7126/snapshots/1"; var result = ccontext.GetConfBusinessCriteria(cdomainHref); Assert.AreEqual("避免工件的已注释掉代码行/代码行的比率过高", result.Name); TestUtility.SetCulture("en-US"); ICastRepsitory ccontext2 = new CastRepository(_connection3, null); const string cdomainHref2 = "AAD/quality-indicators/7126/snapshots/1"; var result2 = ccontext2.GetConfBusinessCriteria(cdomainHref2); Assert.AreEqual("Avoid Artifacts with high Commented-out Code Lines/Code Lines ratio", result2.Name); return; } bool valid = ccontext.IsServiceValid(); Assert.IsTrue(valid); }
public void GetApplicationTest() { ICastRepsitory context = new CastRepository(_Connection); string appilcationId = "ADG705/applications/3"; Application result = context.GetApplication(appilcationId); Assert.IsNotNull(result); }
/// <summary> /// /// </summary> protected ICastRepsitory GetRepository() { CastRepository repo = new CastRepository(Connection, Client); Client = repo.GetClient(); return(repo); }
protected static ICastRepsitory GetRepository(WSConnection connection, bool dropCookie = false) { CastRepository repo = dropCookie ? new CastRepository(connection, null) : new CastRepository(connection, Client); Client = repo.GetClient(); return(repo); }
/// <summary> /// /// </summary> /// <returns></returns> static public bool CheckService(WSConnection connection) { using (ICastRepsitory castRepsitory = new CastRepository(connection)) { return(castRepsitory.IsServiceValid()); } }
public Cast FindCast(string _link) { var castRepository = new CastRepository(); Cast selectedCast = new Cast(); selectedCast = castRepository.FindWithLink(x => x.castLink == _link); return(selectedCast); }
public void GetApplicationTest() { ICastRepsitory context = new CastRepository(_connection); string appilcationId = "AED1/applications/3"; Application result = context.GetApplication(appilcationId); Assert.IsNotNull(result); }
public void GetSnapshotTest() { ICastRepsitory context = new CastRepository(_connection); string snapshotId = "AED1/applications/3/snapshots/2"; Snapshot result = context.GetSnapshot(snapshotId); Assert.IsNotNull(result); }
public void GetModuleTest() { ICastRepsitory context = new CastRepository(_connection); string moduleId = "AED1/modules/4"; Module result = context.GetModule(moduleId); Assert.IsNotNull(result); }
public void IsServiceValidTest() { ICastRepsitory context = new CastRepository(_connection); bool result = context.IsServiceValid(); Assert.IsTrue(result); }
public void GetDomainsTest() { ICastRepsitory context = new CastRepository(_connection); IEnumerable <CastDomain> result = context.GetDomains(); Assert.IsNotNull(result); Assert.AreNotEqual(result.Count(), 0); }
public void GetApplicationsByDomainTest() { string domainHref = "ADG705"; ICastRepsitory context = new CastRepository(_Connection); IEnumerable<Application> result = context.GetApplicationsByDomain(domainHref); Assert.IsNotNull(result); }
static void Main(string[] args) { //Prepare for importing movies var movieDatabase = new MovieDatabase(); _castRepository = new CastRepository(movieDatabase); _movieRepository = new MovieRepository(movieDatabase); _genreRepository = new GenreRepository(movieDatabase); //import movies from json file: importedmovies.json in folder: User\Documents\Project\Movies\Movies\bin\Debug GetImportedMovies(); //Menu options to run methods var menuOption = MainMenu(); while (menuOption < 7) { switch (menuOption) { case 1: GetAllMovies(); break; case 2: GetAllCasts(); break; case 3: GetAllGenres(); break; case 4: AddMovie(); break; case 5: AddCast(); break; case 6: AddGenre(); break; case 7: break; default: Console.WriteLine("You chose an invalid option."); Clear(); break; } if (menuOption != 7) { menuOption = MainMenu(); } } }
public async Task PrintAllAsync() { var castCollection = await CastRepository.GetAllAsync(); foreach (var i in castCollection) { Console.WriteLine(i.Id + " \t " + i.id); } }
public void GetSnapshotsByApplicationTest() { ICastRepsitory context = new CastRepository(_connection, null); string appilcationId = "AED1/applications/3"; var result = context.GetSnapshotsByApplication(appilcationId); Assert.IsNotNull(result); Assert.AreNotEqual(result.Count(), 0); }
public void GetApplicationsByDomainTest() { string domainHref = "AED1"; ICastRepsitory context = new CastRepository(_connection); IEnumerable <Application> result = context.GetApplicationsByDomain(domainHref); Assert.IsNotNull(result); }
public void GetModulesBySnapshotTest() { ICastRepsitory context = new CastRepository(_connection); string appilcationId = "AED1/applications/3/snapshots/2"; var result = context.GetModules(appilcationId); Assert.IsNotNull(result); Assert.AreNotEqual(result.Count(), 0); }
public void GetConfBusinessCriteria() { ICastRepsitory context = new CastRepository(_connection); const string domainHref = "AED1/quality-indicators/61001/snapshots/2"; var result = context.GetConfBusinessCriteria(domainHref); Assert.IsNotNull(result); }
public void GetModulesByApplicationTest() { ICastRepsitory context = new CastRepository(_Connection); string appilcationId = "ADG705/applications/3"; var result = context.GetModules(appilcationId); Assert.IsNotNull(result); Assert.AreNotEqual(result.Count(), 0); }
public int CastGenerateCastId(Director _director) { Cast castForInsert = new Cast(); castForInsert.castLink = _director.directorLink; castForInsert.nameSurname = _director.NameSurname; var castRepository = new CastRepository(); castRepository.Insert(castForInsert); return(castForInsert.castId); }
public int CastGenerateCastId(Writer _writer) { Cast castForInsert = new Cast(); castForInsert.castLink = _writer.writerLink; castForInsert.nameSurname = _writer.NameSurname; var castRepository = new CastRepository(); castRepository.Insert(castForInsert); return(castForInsert.castId); }
public int CastGenerateCastId(Star _star) { Cast castForInsert = new Cast(); castForInsert.castLink = _star.starLink; castForInsert.nameSurname = _star.NameSurname; var castRepository = new CastRepository(); castRepository.Insert(castForInsert); return(castForInsert.castId); }
public void GetConfBusinessCriteriaBySnapshot() { ICastRepsitory context = new CastRepository(_connection); const string domainHref = "AED1"; const int snapshotId = 1; var result = context.GetConfBusinessCriteriaBySnapshot(domainHref, snapshotId); Assert.IsNotNull(result); Assert.AreNotEqual(result.Count(), 0); }
public void IsHttpsTlsv12ServiceValidTest() { // Ignored on jenkins machine, because the certificat tomcat.cer is not installed, and test failed if (Environment.MachineName != "ABDLAP2") { return; } ICastRepsitory context2 = new CastRepository(_connection2); bool result = context2.IsServiceValid(); Assert.IsTrue(result); }
public void CreateAsync_ShowIsNull() { // Given Cast cast = null; using (var context = new DatabaseContext(options)) { var castRepository = new CastRepository(context); Assert.ThrowsAsync <ArgumentNullException>(async() => await castRepository.CreateCastAsync(cast)); } }
public void GetSizingMeasuresByApplicationTest() { ICastRepsitory context = new CastRepository(_Connection); string snapshotRef = "ADG705/applications/5"; Int32[] sizingMeasures = (Int32[])Enum.GetValues(typeof(Constants.SizingInformations)); string strSizingMeasures = string.Join(",", sizingMeasures); var result = context.GetResultsSizingMeasures(snapshotRef, strSizingMeasures, "$all", String.Empty, String.Empty); Assert.IsNotNull(result); Assert.AreNotEqual(result.Count(), 0); Assert.AreNotEqual(result.First().ApplicationResults.Count(), 0); Assert.AreNotEqual(result.First().ApplicationResults[0].TechnologyResult.Count(), 0); }
public void GetQualityIndicatorsByApplicationTest() { ICastRepsitory context = new CastRepository(_Connection); string appilcationRef = "ADG705/applications/3"; Int32[] businessCriterias = (Int32[])Enum.GetValues(typeof(Constants.BusinessCriteria)); string strBusinessCriterias = string.Join(",", businessCriterias); var result = context.GetResultsQualityIndicators(appilcationRef, strBusinessCriterias, "$all", string.Empty, string.Empty, string.Empty); Assert.IsNotNull(result); Assert.AreNotEqual(result.Count(), 0); Assert.AreNotEqual(result.First().ApplicationResults.Count(), 0); }
public void GetSizingMeasuresByApplicationTest() { ICastRepsitory context = new CastRepository(_connection); const string snapshotRef = "AED1/applications/3"; int[] sizingMeasures = (int[])Enum.GetValues(typeof(Constants.SizingInformations)); string strSizingMeasures = string.Join(",", sizingMeasures); var result = context.GetResultsSizingMeasures(snapshotRef, strSizingMeasures, "$all", "$all", "$all"); Assert.IsNotNull(result); var _enumerable = result as IList <Result> ?? result.ToList(); Assert.AreNotEqual(_enumerable.Count, 0); Assert.AreNotEqual(_enumerable.First().ApplicationResults.Length, 0); Assert.AreNotEqual(_enumerable.First().ApplicationResults[0].TechnologyResult.Length, 0); }
public void GetQualityIndicatorsByApplicationTest() { ICastRepsitory context = new CastRepository(_connection); const string appilcationRef = "AED1/applications/3"; int[] businessCriterias = (int[])Enum.GetValues(typeof(Constants.BusinessCriteria)); string strBusinessCriterias = string.Join(",", businessCriterias); var result = context.GetResultsQualityIndicators(appilcationRef, strBusinessCriterias, "$all", string.Empty, string.Empty); Assert.IsNotNull(result); var _enumerable = result as IList <Result> ?? result.ToList(); Assert.AreNotEqual(_enumerable.Count, 0); Assert.AreNotEqual(_enumerable.First().ApplicationResults.Length, 0); }
public CastRepositoryTests() { SetupData(); _mockedContext = new Mock <PlayScraperContext>(); _mockedCast = new Mock <DbSet <Cast> >(); _mockedCast.As <IQueryable <Cast> >().Setup(m => m.Provider).Returns(_castMembers.Provider); _mockedCast.As <IQueryable <Cast> >().Setup(m => m.Expression).Returns(_castMembers.Expression); _mockedCast.As <IQueryable <Cast> >().Setup(m => m.ElementType).Returns(_castMembers.ElementType); _mockedCast.As <IQueryable <Cast> >().Setup(m => m.GetEnumerator()).Returns(_castMembers.GetEnumerator()); _mockedContext.Setup(x => x.Cast).Returns(_mockedCast.Object); _mockedContext.Setup(x => x.Cast.AddRangeAsync(_castMembers, It.IsAny <CancellationToken>())).Returns(Task.FromResult(_mockedCast.Object)); _mockedContext.Setup(x => x.SaveChangesAsync(It.IsAny <CancellationToken>())).Verifiable(); _repository = new CastRepository(_mockedContext.Object); }
public void GetConfQualityRuleChinese() { WSConnection _connection3 = new WSConnection() { Url = "http://dash-aed-tomcat:8888/Dashboard-Noc-170/rest/", Login = "******", Password = "******", IsActive = true, Name = "Default" }; TestUtility.SetCulture("zh-CN"); ICastRepsitory ccontext = new CastRepository(_connection3); if (Environment.UserName != "abd") { if (ccontext == null) { return; } if (!ccontext.IsServiceValid()) { return; } } const string cdomainHref = "ADG83/quality-indicators/7126/snapshots/1"; var result = ccontext.GetConfBusinessCriteria(cdomainHref); Assert.AreEqual("避免工件的已注释掉代码行/代码行的比率过高", result.Name); TestUtility.SetCulture("en-US"); ICastRepsitory ccontext2 = new CastRepository(_connection3); const string cdomainHref2 = "ADG83/quality-indicators/7126/snapshots/1"; var result2 = ccontext2.GetConfBusinessCriteria(cdomainHref2); Assert.AreEqual("Avoid Artifacts with high Commented-out Code Lines/Code Lines ratio", result2.Name); }
public void GetModuleTest() { ICastRepsitory context = new CastRepository(_Connection); string moduleId = "ADG705/modules/4"; Module result = context.GetModule(moduleId); Assert.IsNotNull(result); }
public void GetDomainsTest() { ICastRepsitory context = new CastRepository(_Connection); IEnumerable<CastDomain> result = context.GetDomains(); Assert.IsNotNull(result); Assert.AreNotEqual(result.Count(),0); }
public void GetConfBusinessCriteriaBySnapshot() { ICastRepsitory context = new CastRepository(_Connection); string domainHref = "ADG705"; Int64 snapshotId = 1; var result = context.GetConfBusinessCriteriaBySnapshot(domainHref, snapshotId); Assert.IsNotNull(result); Assert.AreNotEqual(result.Count(), 0); }
public void IsServiceValidTest() { ICastRepsitory context = new CastRepository(_Connection); bool result = context.IsServiceValid(); Assert.IsTrue( result); }
public void GetQualityIndicatorsBySnapshotTest() { ICastRepsitory context = new CastRepository(_Connection); string snapshotRef = "ADG705/applications/5/snapshots/137"; Int32[] businessCriterias = (Int32[])Enum.GetValues(typeof(Constants.BusinessCriteria)); string strBusinessCriterias = string.Join(",", businessCriterias); var result = context.GetResultsQualityIndicators(snapshotRef, strBusinessCriterias, string.Empty, "$all", "$all", "$all"); Assert.IsNotNull(result); Assert.AreNotEqual(result.Count(), 0); Assert.AreNotEqual(result.First().ApplicationResults.Count(), 0); Assert.AreNotEqual(result.First().ApplicationResults[0].ModulesResult.Count(), 0); }
public void GetSnapshotTest() { ICastRepsitory context = new CastRepository(_Connection); string snapshotId = "ADG705/applications/3/snapshots/138"; Snapshot result = context.GetSnapshot(snapshotId); Assert.IsNotNull(result); }
public void GetSizingMeasuresBySnapshotTest() { ICastRepsitory context = new CastRepository(_Connection); string snapshotRef = "ADG705/applications/5/snapshots/137"; Int32[] sizingMeasures = (Int32[])Enum.GetValues(typeof(Constants.SizingInformations)); string strSizingMeasures = string.Join(",", sizingMeasures); var result = context.GetResultsSizingMeasures(snapshotRef, strSizingMeasures, string.Empty, "$all", "$all"); Assert.IsNotNull(result); Assert.AreNotEqual(result.Count(), 0); Assert.AreNotEqual(result.First().ApplicationResults.Count(), 0); Assert.AreNotEqual(result.First().ApplicationResults[0].TechnologyResult.Count(), 0); }
public void GetConfBusinessCriteria() { ICastRepsitory context = new CastRepository(_Connection); string domainHref = "ADG710/quality-indicators/61001/snapshots/14"; var result = context.GetConfBusinessCriteria(domainHref); Assert.IsNotNull(result); }
public CastService() { _castRepository = new CastRepository(new MovieShopDbContext()); }
public void GetSnapshotsByApplicationTest() { ICastRepsitory context = new CastRepository(_Connection); string appilcationId = "ADG705/applications/3"; var result = context.GetSnapshotsByApplication(appilcationId); Assert.IsNotNull(result); Assert.AreNotEqual(result.Count(), 0); }