public override void Given() { grades = new List <LookupViewModel> { new LookupViewModel { Id = 1, Code = "C1", Value = "V1" }, new LookupViewModel { Id = 2, Code = "C2", Value = "V2" } }; mockresult = new ManageCoreResultViewModel { ProfileId = 1, PathwayDisplayName = "Pathway (7654321)", AssessmentSeries = "Summer 2021", AssessmentId = 11, ResultId = 111, SelectedGradeCode = string.Empty, Grades = grades }; _routeAttributes = new Dictionary <string, string> { { Constants.ProfileId, ProfileId.ToString() } }; ResultLoader.GetManageCoreResultAsync(AoUkprn, ProfileId, AssessmentId, true).Returns(mockresult); }
public override int GetHashCode() { int hash = 1; if (ProfileId.Length != 0) { hash ^= ProfileId.GetHashCode(); } if (ProposalId.Length != 0) { hash ^= ProposalId.GetHashCode(); } if (ResultId.Length != 0) { hash ^= ResultId.GetHashCode(); } if (matchObject_ != null) { hash ^= MatchObject.GetHashCode(); } if (Timestamp.Length != 0) { hash ^= Timestamp.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public ReportRequest CreateReportRequest() { return(new ReportRequest { ViewId = ProfileId.StartsWith("ga:") ? ProfileId : $"ga:{ProfileId}", DateRanges = new List <DateRange> { new DateRange { StartDate = StartDate.ToString(GA_DATE_FORMAT), EndDate = EndDate.ToString(GA_DATE_FORMAT) } }, Metrics = Metrics .Select(metric => new Metric { Expression = metric.StartsWith("ga:") ? metric : $"ga:{metric}" }) .ToList(), Dimensions = Dimensions .Select(dimension => new Dimension { Name = dimension.StartsWith("ga:") ? dimension : $"ga:{dimension}" }) .ToList(), FiltersExpression = Filters, PageSize = PageSize, PageToken = NextPageToken }); }
public static Player GetPlayer(ProfileId position) { var player = CAPGen.GeneratePlayer(position); player.CreatePlayer(); return(player); }
public NamedStoragePersistanceStrategy(IProfileStoragePersister persister, ProfileId profileId, TypeNameWithoutVersion key, params StorageName[] storageNames) { _persister = persister; _profileId = profileId; _key = key; _storageNames = storageNames; }
public override void Given() { mockresult = new ResultDetailsViewModel { ProfileId = 1, Uln = 1234567890, Name = "Test", ProviderDisplayName = "Test Provider (1234567)", PathwayDisplayName = "Pathway (7654321)", PathwayAssessmentSeries = "Summer 2021", PathwayAssessmentId = 11, SpecialismDisplayName = "Specialism1 (2345678)", PathwayResult = "A", PathwayResultId = 123, PathwayStatus = RegistrationPathwayStatus.Active }; _routeAttributes = new Dictionary <string, string> { { Constants.ProfileId, ProfileId.ToString() }, { Constants.AssessmentId, mockresult.PathwayAssessmentId.ToString() } }; ResultLoader.GetResultDetailsAsync(AoUkprn, ProfileId, RegistrationPathwayStatus.Active).Returns(mockresult); }
public void Then_Expected_Results_Returned() { Result.Should().NotBeNull(); Result.Should().BeOfType(typeof(ViewResult)); var viewResult = Result as ViewResult; viewResult.Model.Should().BeOfType(typeof(AddAssessmentEntryViewModel)); var model = viewResult.Model as AddAssessmentEntryViewModel; model.Should().NotBeNull(); model.ProfileId.Should().Be(ViewModel.ProfileId); model.AssessmentSeriesId.Should().Be(ViewModel.AssessmentSeriesId); model.AssessmentSeriesName.Should().Be(ViewModel.AssessmentSeriesName); model.IsOpted.Should().BeNull(); Controller.ViewData.ModelState.ContainsKey(nameof(AddAssessmentEntryViewModel.IsOpted)).Should().BeTrue(); var modelState = Controller.ViewData.ModelState[nameof(AddAssessmentEntryViewModel.IsOpted)]; modelState.Errors[0].ErrorMessage.Should().Be(AssessmentContent.AddCoreAssessmentEntry.Select_Option_To_Add_Validation_Text); // Backlink var backLink = model.BackLink; backLink.RouteName.Should().Be(RouteConstants.AssessmentDetails); backLink.RouteAttributes.Count.Should().Be(1); backLink.RouteAttributes.TryGetValue(Constants.ProfileId, out string routeValue); routeValue.Should().Be(ProfileId.ToString()); }
public void Delete(ProfileId profileId, TypeNameWithoutVersion key) { using (var context = CreateContext()) { const string cmd = "delete dbo.ProfileStorage where dbo.ProfileStorage.ProfileId = {0} AND dbo.ProfileStorage.ValueKey = {1}"; context.ExecuteCommand(cmd, profileId.Value, key.Value); } }
/// <summary> /// Check if this instance is equal to another object that /// implements <see cref="IProfileMetaData"/>. /// </summary> /// <param name="other"> /// The <see cref="IProfileMetaData"/> to check for equality /// </param> /// <returns> /// True if the two instances are equal. /// False otherwise /// </returns> public bool Equals(IProfileMetaData other) { if (other == null) { return(false); } return(ProfileId.Equals(other.ProfileId)); }
/// <summary> /// Compare this instance to another object that implements /// <see cref="IProfileMetaData"/>. /// </summary> /// <param name="other"> /// The <see cref="IProfileMetaData"/> instance to compare to. /// </param> /// <returns> /// >0 if this instance precedes `other` in the sort order. /// 0 if they are equal in the sort order. /// <0 if `other` precedes this instance in the sort order. /// </returns> public int CompareTo(IProfileMetaData other) { if (other == null) { return(-1); } return(ProfileId.CompareTo(other.ProfileId)); }
public void Delete(ProfileId profileId, TypeNameWithoutVersion key) { using (var context = CreateContext()) { const string cmd = "delete dbo.ProfileStorage where dbo.ProfileStorage.ProfileId = {0} AND dbo.ProfileStorage.ValueKey = {1}"; context.ExecuteCommand(cmd, profileId.Value, key.Value); } }
public static Player GeneratePlayer(ProfileId Id) { switch (Id) { case ProfileId.QB_Scrambling: case ProfileId.QB_PocketPasser: case ProfileId.QB_Balanced: return(QB(Id)); case ProfileId.HB_Balanced: case ProfileId.HB_Power: case ProfileId.HB_Speed: return(HB(Id)); case ProfileId.WR_Balanced: case ProfileId.WR_Possession: case ProfileId.WR_Speed: return(WR(Id)); /*case ProfileId.TE_Blocking: * case ProfileId.TE_Recieving: * case ProfileId.TE_Balanced:*/ case ProfileId.TE: return(new TE(Id)); case ProfileId.ROLB: case ProfileId.LOLB: return(new OLB(Id)); case ProfileId.SS: return(new SS(Id)); case ProfileId.CB: return(new CB(Id)); case ProfileId.MLB: return(new MLB(Id)); case ProfileId.FS: return(new FS(Id)); case ProfileId.FB: return(new FB(Id)); case ProfileId.DE: return(new DE(Id)); case ProfileId.DT: return(new DT(Id)); case ProfileId.OL: return(new OL(Id)); default: break; } return(null); }
public IEnumerable <ProfileStorage> FindBy(ProfileId profileId) { using (var context = CreateContext()) { return((from profileStorage in context.ProfileStorages where profileStorage.ProfileId == profileId.Value select profileStorage).ToArray()); } }
public IEnumerable<ProfileStorage> FindBy(ProfileId profileId) { using (var context = CreateContext()) { return (from profileStorage in context.ProfileStorages where profileStorage.ProfileId == profileId.Value select profileStorage).ToArray(); } }
void IXmlSerializable.WriteXml(System.Xml.XmlWriter a) { a.WriteElementString("DefaultValueGroupId", DefaultValueGroupId.ToString()); a.WriteElementString("FullName", FullName); a.WriteElementString("GroupRoleId", GroupRoleId.ToString()); a.WriteStartElement("IsAnonymous"); a.WriteValue(IsAnonymous); a.WriteEndElement(); a.WriteElementString("SearchMode", SearchMode.ToString()); a.WriteDateTimeOffset(LastActivityDate, "LastActivityDate"); a.WriteDateTimeOffset(LastUpdatedDate, "LastUpdatedDate"); a.WriteElementString("ProfileId", ProfileId.ToString()); a.WriteStartElement("Properties"); if (Properties != null) { var b = new XmlSerializer(typeof(ProfileProperty), new XmlRootAttribute("ProfileProperty")); foreach (IXmlSerializable i in Properties) { b.Serialize(a, i); } } a.WriteEndElement(); a.WriteStartElement("RoleSet"); if (RoleSet != null) { ((IXmlSerializable)RoleSet).WriteXml(a); } a.WriteEndElement(); a.WriteStartElement("Source"); if (Source != null) { ((IXmlSerializable)Source).WriteXml(a); } a.WriteEndElement(); a.WriteElementString("SourceId", SourceId.ToString()); a.WriteElementString("UserId", UserId.ToString()); a.WriteElementString("UserName", UserName); a.WriteStartElement("MarkGroupId"); if (MarkGroupId.HasValue) { a.WriteValue(MarkGroupId.Value); } a.WriteEndElement(); a.WriteStartElement("SellerTreeId"); if (SellerTreeId.HasValue) { a.WriteValue(SellerTreeId.Value); } a.WriteEndElement(); a.WriteStartElement("IntermediateId"); if (IntermediateId.HasValue) { a.WriteValue(IntermediateId.Value); } a.WriteEndElement(); }
public override string ToString() { string input = InputClusterList != null?string.Join(", ", InputClusterList) : ""; string output = OutputClusterList != null?string.Join(", ", OutputClusterList) : ""; return("SimpleDescriptor [endpoint=" + Endpoint + ", profileId=" + ProfileId.ToString("X4") + ", deviceId=" + DeviceId + ", deviceVersion=" + DeviceVersion + ", inputClusterList=" + input + ", outputClusterList=" + output + "]"); }
public async Task <ClaimsIdentity> GenerateUserIdentityAsync(UserManager <AppUser> manager) { // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie); // Add custom user claims here userIdentity.AddClaim(new Claim("ProfileId", ProfileId.ToString())); userIdentity.AddClaim(new Claim("AuthorId", AuthorId.ToString())); return(userIdentity); }
public void Delete(ProfileId profileId, TypeNameWithoutVersion key, params StorageName[] storageNames) { using (var context = CreateContext()) { var inClausePlaceholders = string.Join(",", storageNames.Select((x, i) => "{{{0}}}".Fmt(i + 2))); var parameters = new object[] { profileId.Value, key.Value }.Concat(storageNames.Select(x => x.Value)); var cmd = "delete dbo.ProfileStorage where dbo.ProfileStorage.ProfileId = {0} AND dbo.ProfileStorage.ValueKey = {1} AND dbo.ProfileStorage.Name IN (" + inClausePlaceholders + ")"; context.ExecuteCommand(cmd, parameters.ToArray()); } }
public QB(ProfileId Position) { this.Position = Position; this.Pos = "QB"; if ((CAPGen.RAND.Next(0, Int32.MaxValue) % 10) == 0) { this.Pos += " (LH)"; } this.TendencyOverride = ((int)Position).ToString(); }
public void Delete(ProfileId profileId, TypeNameWithoutVersion key, params StorageName[] storageNames) { using (var context = CreateContext()) { var inClausePlaceholders = string.Join(",", storageNames.Select((x, i) => "{{{0}}}".Fmt(i + 2))); var parameters = new object[] { profileId.Value, key.Value }.Concat(storageNames.Select(x => x.Value)); var cmd = "delete dbo.ProfileStorage where dbo.ProfileStorage.ProfileId = {0} AND dbo.ProfileStorage.ValueKey = {1} AND dbo.ProfileStorage.Name IN (" + inClausePlaceholders + ")"; context.ExecuteCommand(cmd, parameters.ToArray()); } }
public bool Equals(DbStats?other) { return(other != null && Id.Equals(other.Id) && ProfileId.Equals(other.ProfileId) && ChapterId.Equals(other.ChapterId) && Completed == other.Completed && Tips.SequenceEqual(other.Tips) && Submits.SequenceEqual(other.Submits) && Failures.SequenceEqual(other.Failures)); }
public bool Equals(ProfileId other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(other.Value, Value)); }
public IEnumerable <ProfileStorage> FindBy(ProfileId profileId, TypeNameWithoutVersion key) { using (var context = CreateContext()) { int id = profileId.Value; string valueKey = key.Value; return((from profileStorage in context.ProfileStorages where profileStorage.ProfileId == id && profileStorage.ValueKey == valueKey select profileStorage).ToArray()); } }
public IEnumerable <ProfileStorage> FindBy(ProfileId profileId, TypeNameWithoutVersion key, params StorageName[] storageNames) { using (var context = CreateContext()) { int id = profileId.Value; string valueKey = key.Value; var starageNameValues = storageNames.Select(s => s.Value); return((from profileStorage in context.ProfileStorages where profileStorage.ProfileId == id && profileStorage.ValueKey == valueKey && starageNameValues.Contains(profileStorage.Name) select profileStorage).ToArray()); } }
public override void Given() { _routeAttributes = new Dictionary <string, string> { { Constants.ProfileId, ProfileId.ToString() }, { Constants.IsChangeMode, "true" } }; _reregisterProviderViewModel = new ReregisterProviderViewModel { SelectedProviderUkprn = "98765432", SelectedProviderDisplayName = "Barnsley College (98765432)" }; _reregisterCoreViewModel = new ReregisterCoreViewModel { SelectedCoreCode = _coreCode, SelectedCoreDisplayName = $"Education ({_coreCode})", CoreSelectList = new List <SelectListItem> { new SelectListItem { Text = "Education", Value = _coreCode } } }; _reregisterSpecialismQuestionViewModel = new ReregisterSpecialismQuestionViewModel { HasLearnerDecidedSpecialism = true }; _pathwaySpecialismsViewModel = new PathwaySpecialismsViewModel { PathwayCode = _coreCode, PathwayName = "Education", Specialisms = new List <SpecialismDetailsViewModel> { new SpecialismDetailsViewModel { Code = "7654321", Name = "Test Education", DisplayName = "Test Education (7654321)", IsSelected = true } } }; _reregisterSpecialismViewModel = new ReregisterSpecialismViewModel { PathwaySpecialisms = _pathwaySpecialismsViewModel }; _academicYearViewModel = new ReregisterAcademicYearViewModel { ProfileId = ProfileId, SelectedAcademicYear = "2020" }; cacheResult = new ReregisterViewModel { ReregisterProvider = _reregisterProviderViewModel, ReregisterCore = _reregisterCoreViewModel, SpecialismQuestion = _reregisterSpecialismQuestionViewModel, ReregisterSpecialisms = _reregisterSpecialismViewModel, ReregisterAcademicYear = _academicYearViewModel }; _registrationDetails = new RegistrationDetailsViewModel { ProfileId = 1, Uln = _uln, Status = _registrationPathwayStatus }; RegistrationLoader.GetRegistrationDetailsAsync(AoUkprn, ProfileId, RegistrationPathwayStatus.Withdrawn).Returns(_registrationDetails); CacheService.GetAsync <ReregisterViewModel>(CacheKey).Returns(cacheResult); }
public ProfileToStorageAdapter(ProfileId profileId, IProfileStoragePersister persister, Type keyType, params StorageName[] storageNames) { _profileId = profileId; _key = ProfileStorage.Key(keyType); if (storageNames == null) { _persistanceStrategy = new NotNamedStoragePersistanceStrategy(persister, profileId, _key); } else { _persistanceStrategy = new NamedStoragePersistanceStrategy(persister, profileId, _key, storageNames); } }
public static Player GetRandomPlayer() { Array values = Enum.GetValues(typeof(ProfileId)); ProfileId curr = (ProfileId)values.GetValue(CAPGen.RAND.Next(0, values.Length)); var player = CAPGen.GeneratePlayer(curr); if (player == null) { return(null); } player.CreatePlayer(); return(player); }
public string GetProperty(string propertyName, string format, System.Globalization.CultureInfo formatProvider, Entities.Users.UserInfo accessingUser, Scope accessLevel, ref bool propertyNotFound) { string OutputFormat = string.Empty; if (format == string.Empty) { OutputFormat = "g"; } else { OutputFormat = format; } propertyName = propertyName.ToLowerInvariant(); switch (propertyName) { case "journalid": return(PropertyAccess.FormatString(JournalId.ToString(), format)); case "journaltypeid": return(PropertyAccess.FormatString(JournalTypeId.ToString(), format)); case "profileid": return(PropertyAccess.FormatString(ProfileId.ToString(), format)); case "socialgroupid": return(PropertyAccess.FormatString(SocialGroupId.ToString(), format)); case "datecreated": return(PropertyAccess.FormatString(DateCreated.ToString(), format)); case "title": return(PropertyAccess.FormatString(Title, format)); case "summary": return(PropertyAccess.FormatString(Summary, format)); case "body": return(PropertyAccess.FormatString(Body, format)); case "timeframe": return(PropertyAccess.FormatString(TimeFrame, format)); case "isdeleted": return(IsDeleted.ToString()); } propertyNotFound = true; return(string.Empty); }
public void Then_Expected_Results_Are_Returned() { Result.Should().NotBeNull(); (Result as ViewResult).Model.Should().NotBeNull(); var model = (Result as ViewResult).Model as ChangePostalAddressViewModel; model.ProfileId.Should().Be(ProfileId); // Back link model.BackLink.Should().NotBeNull(); model.BackLink.RouteName.Should().Be(RouteConstants.RequestSoaCheckAndSubmit); model.BackLink.RouteAttributes.Count.Should().Be(1); model.BackLink.RouteAttributes.TryGetValue(Constants.ProfileId, out string routeValue); routeValue.Should().Be(ProfileId.ToString()); }
public void Then_Returns_Expected_Results() { Result.Should().NotBeNull(); (Result as ViewResult).Model.Should().NotBeNull(); var model = (Result as ViewResult).Model as QueryEnglishAndMathsViewModel; model.ProfileId.Should().Be(mockresult.ProfileId); model.Name.Should().Be(mockresult.Name); model.BackLink.Should().NotBeNull(); model.BackLink.RouteName.Should().Be(RouteConstants.LearnerRecordDetails); model.BackLink.RouteAttributes.Count.Should().Be(1); model.BackLink.RouteAttributes.TryGetValue(Constants.ProfileId, out string routeValue); routeValue.Should().Be(ProfileId.ToString()); }
public string Validate() { var appIdDigits = appId.GetDigitsQuantity(); if (ProfileId.GetDigitsQuantity() != 17) { return("Profile Id must to contain of 17 digits"); } else if (frequency < 5) { return("Frequency must to be positive and more than 5 seconds"); } else if (appIdDigits < 3 || appIdDigits > 6) { return("App Id must to be between 3 and 6 digits"); } return(string.Empty); }
/// <summary> /// Escreve os dados no XML. /// </summary> /// <param name="writer"></param> void IXmlSerializable.WriteXml(System.Xml.XmlWriter writer) { writer.WriteElementString("ProfileId", ProfileId.ToString()); writer.WriteElementString("UserName", this.UserName); writer.WriteElementString("FullName", this.FullName); writer.WriteElementString("SearchMode", this.SearchMode.ToString()); writer.WriteDateTimeOffset(LastActivityDate, "LastActivityDate"); writer.WriteDateTimeOffset(LastUpdatedDate, "LastUpdatedDate"); writer.WriteStartElement("Source", null); if (Source != null) { ((IXmlSerializable)Source).WriteXml(writer); } writer.WriteEndElement(); writer.WriteStartElement("IsAnonymous", null); writer.WriteValue(IsAnonymous); writer.WriteEndElement(); writer.WriteStartElement("MarkGroupId"); if (MarkGroupId.HasValue) { writer.WriteValue(MarkGroupId.Value); } writer.WriteEndElement(); writer.WriteStartElement("SellerTreeId"); if (SellerTreeId.HasValue) { writer.WriteValue(SellerTreeId.Value); } writer.WriteEndElement(); writer.WriteStartElement("IntermediateId"); if (IntermediateId.HasValue) { writer.WriteValue(IntermediateId.Value); } writer.WriteEndElement(); }
public override int GetHashCode() { unchecked { var hashCode = base.GetHashCode(); hashCode = (hashCode * 397) ^ ProfileId.GetHashCode(); hashCode = (hashCode * 397) ^ (int)Education; hashCode = (hashCode * 397) ^ (int)Position; hashCode = (hashCode * 397) ^ ProjectsCourses.GetHashCode(); hashCode = (hashCode * 397) ^ ProjectsPersonal.GetHashCode(); hashCode = (hashCode * 397) ^ ProjectsSharedSmall.GetHashCode(); hashCode = (hashCode * 397) ^ ProjectsSharedMedium.GetHashCode(); hashCode = (hashCode * 397) ^ ProjectsSharedLarge.GetHashCode(); hashCode = (hashCode * 397) ^ TeamsSolo.GetHashCode(); hashCode = (hashCode * 397) ^ TeamsSmall.GetHashCode(); hashCode = (hashCode * 397) ^ TeamsMedium.GetHashCode(); hashCode = (hashCode * 397) ^ TeamsLarge.GetHashCode(); hashCode = (hashCode * 397) ^ (int)CodeReviews; hashCode = (hashCode * 397) ^ (int)ProgrammingGeneral; hashCode = (hashCode * 397) ^ (int)ProgrammingCSharp; hashCode = (hashCode * 397) ^ Comment.GetHashCode(); return(hashCode); } }
public IEnumerable<ProfileStorage> FindBy(ProfileId profileId, TypeNameWithoutVersion key) { using (var context = CreateContext()) { int id = profileId.Value; string valueKey = key.Value; return (from profileStorage in context.ProfileStorages where profileStorage.ProfileId == id && profileStorage.ValueKey == valueKey select profileStorage).ToArray(); } }
public ProfileStorage FindBy(ProfileId profileId, TypeNameWithoutVersion key, object item) { var itemsToSearch = FindBy(profileId, key); return itemsToSearch.Where(profileStorage => profileStorage.GetValue().Equals(item)).FirstOrDefault(); }
public bool Contains(StorageName storageName, ProfileId profileId, TypeNameWithoutVersion key, object item) { return FindBy(storageName, profileId, key, item) != null; }
public IEnumerable<ProfileStorage> FindBy(ProfileId profileId, TypeNameWithoutVersion key, params StorageName[] storageNames) { using (var context = CreateContext()) { int id = profileId.Value; string valueKey = key.Value; var starageNameValues = storageNames.Select(s => s.Value); return (from profileStorage in context.ProfileStorages where profileStorage.ProfileId == id && profileStorage.ValueKey == valueKey && starageNameValues.Contains(profileStorage.Name) select profileStorage).ToArray(); } }
public ProfileStorageCollection(ProfileId profileId, IProfileStoragePersister persister) { _profileId = profileId; _persister = persister; }
public bool Equals(ProfileId other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.Value, Value); }