private static bool SameStatusValues(RegisterSummary rs1, RegisterSummary rs2) { if (rs1.Status == null && rs2.Status == null) { return(true); } if (rs1.Status == null || rs2.Status == null) { return(false); } if (rs1.Status.Length != rs2.Status.Length) { return(false); } for (int n = 0; n < rs1.Status.Length; ++n) { if (rs1.Status[n] != rs2.Status[n]) { return(false); } } return(true); }
protected override async Task TestGetItem() { foreach (var r in FRegSummaries) { RegisterSummary reg = await TestGetIndividualRegisterSummary(r.Id); reg.CheckSameValues(r); } }
public static bool SameValue(this RegisterSummary lhs, RegisterSummary rhs) { return (SameStatusValues(lhs, rhs) && lhs.Id == rhs.Id && lhs.EventId == rhs.EventId && lhs.Week == rhs.Week && lhs.ActivityId == rhs.ActivityId && lhs.StartDateTime == rhs.StartDateTime && lhs.EndDateTime == rhs.EndDateTime && lhs.StudentCount == rhs.StudentCount && lhs.MarkCount == rhs.MarkCount && SameEntities(lhs, rhs)); }
private static bool SameEntities(RegisterSummary rs1, RegisterSummary rs2) { if (rs1.Entities == null && rs2.Entities == null) { return(true); } if (rs1.Entities == null || rs2.Entities == null) { return(false); } if (rs1.Entities.Count != rs2.Entities.Count) { return(false); } foreach (var key in rs1.Entities.Keys) { var names1 = rs1.Entities[key]; var names2 = rs2.Entities[key]; foreach (var keyB in names1.Keys) { var namesB1 = names1[keyB]; var namesB2 = names2[keyB]; if (namesB1.UniqueName != namesB2.UniqueName) { return(false); } } } return(true); }