public void SimpleTaskFactoryParsingTest(TaskSpecification taskSpecs, Model.Task expectedTask) { var parser = new TaskFactory(); var actualTask = parser.MakeTask(taskSpecs); Assert.IsTrue(expectedTask.Equals(actualTask)); }
/// <summary> /// Returns true if Car instances are equal /// </summary> /// <param name="other">Instance of Car to be compared</param> /// <returns>Boolean</returns> public bool Equals(Car other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( LicensePlate == other.LicensePlate || LicensePlate != null && LicensePlate.Equals(other.LicensePlate) ) && ( Model == other.Model || Model != null && Model.Equals(other.Model) ) && ( Type == other.Type || Type != null && Type.Equals(other.Type) )); }
protected bool Equals(Car car) { return(Make.Equals(car.Make) && Model.Equals(car.Model) && Year.Equals(car.Year) && CharacteristicsCar.Equals(car.CharacteristicsCar)); }
public bool Equals(CarGenerator other) { if (other == null) { return(false); } return(Model.Equals(other.Model) && Position.Equals(other.Position) && Heading.Equals(other.Heading) && Color1.Equals(other.Color1) && Color2.Equals(other.Color2) && ForceSpawn.Equals(other.ForceSpawn) && AlarmChance.Equals(other.AlarmChance) && LockedChance.Equals(other.LockedChance) && MinDelay.Equals(other.MinDelay) && MaxDelay.Equals(other.MaxDelay) && Timer.Equals(other.Timer) && Handle.Equals(other.Handle) && Enabled.Equals(other.Enabled) && IsBlocking.Equals(other.IsBlocking) && CollisionBoundingMin.Equals(other.CollisionBoundingMin) && CollisionBoundingMax.Equals(other.CollisionBoundingMax) && CollisionSize.Equals(other.CollisionSize)); }
public Output Comparison(int id) { Output result = null; Model leftModel = GetLeft(id); Model rightModel = GetRight(id); if (leftModel != null && rightModel != null) { result = new Output(id); if (leftModel.Equals(rightModel)) { Console.WriteLine("They are equal!"); } else if (leftModel.Value.Length != rightModel.Value.Length) { Console.WriteLine("They have different length!"); } else { Console.WriteLine("They are different!"); result.ListDifferents = GetDifferences(rightModel, leftModel); } } return(result); }
public void SimpleWorkerFactoryParsingTest(WorkerSpecification workerSpecs, Model.Worker expectedWorker) { var parser = new WorkerFactory(); var actualTask = parser.MakeWorker(workerSpecs); Assert.IsTrue(expectedWorker.Equals(actualTask)); }
public bool matches(GuitarSpec otherSpec) { if (Builder != otherSpec.Builder) { return(false); } if ((Model != null) && (!Model.Equals("")) && (!Model.ToLower().Equals(otherSpec.Model.ToLower()))) { return(false); } if (Type != otherSpec.Type) { return(false); } if (NumStrings != otherSpec.NumStrings) { return(false); } if (BackWood != otherSpec.BackWood) { return(false); } if (TopWood != otherSpec.TopWood) { return(false); } return(true); }
/// <inheritdoc /> public override bool Equals(object obj) { if ((obj == null) || !(obj is ProgramDescriptionViewModel)) { return(false); } return(Model.Equals(((ProgramDescriptionViewModel)obj).Model)); }
public bool Equals(TabViewModel other) { if (other == null) { return(false); } return(Model.Equals(other.Model)); }
public override bool Equals(object obj) { TagVM tag = obj as TagVM; if (tag == null) { return(false); } return(Model.Equals(tag.Model)); }
public override bool Equals(object obj) { LMTimelineEventVM evt = obj as LMTimelineEventVM; if (evt == null) { return(false); } return(Model.Equals(evt.Model)); }
/// <summary> /// AdmissionExit的二进制数据,前4位为时间,中间16位是打卡ID,最后2位是卡片ID /// </summary> /// <returns></returns> public byte[] backAdminssionExitBinary() { byte[] timeBt = XWUtils.longToFourByte(Time); byte[] bt = new byte[timeBt.Length + workIDbyte.Length + tagIDbyte.Length + 1]; Array.Copy(timeBt, 0, bt, 0, timeBt.Length); Array.Copy(workIDbyte, 0, bt, timeBt.Length, workIDbyte.Length); Array.Copy(tagIDbyte, 0, bt, timeBt.Length + workIDbyte.Length, tagIDbyte.Length); bt[bt.Length - 1] = (byte)(Model.Equals(AdmissionExit.ADMISSION) ? 0 : 1); return(bt); }
public void Update(IBlePeripheral device) { if (!Model.Equals(device)) { return; } Advertisement = Model.Advertisement.ToString(); RaisePropertyChanged(nameof(Rssi)); RaisePropertyChanged(nameof(Name)); }
public bool IsGuitarMatch(GuitarSpec guitarSpec) { if (Model.Equals(guitarSpec.Model) && Type.Equals(guitarSpec.Type) && Builder.Equals(guitarSpec.Builder) && BackWood.Equals(guitarSpec.BackWood) && TopWood.Equals(guitarSpec.TopWood) && NumString.Equals(guitarSpec.NumString)) { return(true); } return(false); }
public void TestModelOverrideEqualsNoAccessories() { var c = new Car("abc"); var expected = true; var m1 = new Model(c, "model", 2000, 2000); var m2 = new Model(c, "model", 2000, 2000); Assert.AreEqual(expected, m1.Equals(m2)); }
public bool ChangeModel(string model) { if (Model.Equals(model)) { return(false); } IsModelUpdated = true; Model = model; return(true); }
public override bool Equals(object obj) { var model = obj as WorksInfoDataCostViewModel; if (model == null) { return(false); } return(model.Mark != null && model.Model != null && Mark.Equals(model.Mark) && Model.Equals(model.Model) && Name.Equals(model.Name)); }
// Is there even a good use for this? /*public void FormIsReady(EditContext e) * { * EditContext = e; * if (ValidateOnInit) * { * ForceValidate(); * } * }*/ protected override void BuildRenderTree(RenderTreeBuilder builder) { if (Model != null && Model.Equals(default(TValue)) && EditContext == null) { builder.OpenElement(0, "form"); builder.AddAttribute(1, "class", ClassBuilder); builder.AddMultipleAttributes(2, Attributes); builder.AddContent(3, ChildContent); builder.CloseElement(); return; } EditFormChildContent = content => { if (content == null) { throw new ArgumentNullException(nameof(content)); } return(child => { if (EditContext != null) { content = EditContext; } child.AddContent(1, ChildContent); }); }; Form = formBuilder => { formBuilder.OpenComponent <EditForm>(0); formBuilder.AddMultipleAttributes(1, Attributes); formBuilder.AddAttribute(2, "class", ClassBuilder); if (EditContext != null) { formBuilder.AddAttribute(3, "EditContext", EditContext); } else { formBuilder.AddAttribute(3, "Model", Model); } formBuilder.AddAttribute(4, "OnSubmit", OnSubmit); formBuilder.AddAttribute(5, "OnValidSubmit", OnValidSubmit); formBuilder.AddAttribute(6, "OnInvalidSubmit", OnInvalidSubmit); formBuilder.AddAttribute(7, "ChildContent", EditFormChildContent); formBuilder.CloseComponent(); }; builder.OpenComponent <CascadingValue <BSForm <TValue> > >(3); builder.AddAttribute(4, "IsFixed", true); builder.AddAttribute(5, "Value", this); builder.AddAttribute(6, "ChildContent", Form); builder.CloseComponent(); }
/// <summary> /// Returns true if DeviceType instances are equal /// </summary> /// <param name="other">Instance of DeviceType to be compared</param> /// <returns>Boolean</returns> public bool Equals(DeviceType other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Vendor == other.Vendor || Vendor != null && Vendor.Equals(other.Vendor) ) && ( HwRev == other.HwRev || HwRev != null && HwRev.Equals(other.HwRev) ) && ( SwRev == other.SwRev || SwRev != null && SwRev.Equals(other.SwRev) ) && ( SerNum == other.SerNum || SerNum != null && SerNum.Equals(other.SerNum) ) && ( Model == other.Model || Model != null && Model.Equals(other.Model) ) && ( Owner == other.Owner || Owner != null && Owner.Equals(other.Owner) ) && ( PrimeOps == other.PrimeOps || PrimeOps != null && PrimeOps.Equals(other.PrimeOps) ) && ( SecondOps == other.SecondOps || SecondOps != null && SecondOps.Equals(other.SecondOps) )); }
public void MisplacedTaskSpecExtractionAndTaskFactoryParsingTest(int entry, Model.Task expectedTask) { ws = (Excel.Worksheet)wss["TestTasks2"]; IEnumerable<Specification> actualTaskSpecs; Assert.IsTrue(excelController.ExtractData(out actualTaskSpecs)); var parser = new TaskFactory(); var actualTask = parser.MakeTasks(actualTaskSpecs.OfType<TaskSpecification>().ToList()); Assert.IsTrue(expectedTask.Equals(actualTask.ElementAt(entry))); }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj.GetType() != this.GetType()) { return(false); } return(Model.Equals(((ChannelViewModel)obj).Model)); }
public virtual ModelElementTypeAssert isPartOfModel(Model model) { NotNull; Model actualModel = actual.Model; if (!model.Equals(actualModel)) { failWithMessage("Expected element type <%s> to be part of model <%s> but was part of <%s>", typeName, model.ModelName, actualModel.ModelName); } return(this); }
//override Equals public override bool Equals(object obj) { Car carObj = obj as Car; if (carObj == null) { return(false); } else { return(Model.Equals(carObj.Model)); } }
public void TestModelOverrideEqualsOneModelHasAccessories() { var c = new Car("abc"); var expected = false; var m1 = new Model(c, "model", 2000, 2000); var m2 = new Model(c, "model", 2000, 2000); var a = new Accessory("abc", 100); m1.AddModelAccessory(a); Assert.AreEqual(expected, m1.Equals(m2)); }
public bool Equals(BikeModel other) { if (other == null) { return(false); } bool makeEqual = Make.Equals(other.Make); bool modelEqual = Model.Equals(other.Model); bool typeEqual = Type.Equals(other.Type); return(makeEqual && modelEqual && typeEqual); }
public override bool Equals(object obj) { if (ReferenceEquals(obj, this)) { return(true); } if (!(obj is IPersistEntity entity)) { return(false); } return(EntityLabel.Equals(entity.EntityLabel) && Model.Equals(entity.Model)); }
internal string Validate() { try { if (IdTypu == 0) { return("Wybierz typ towaru"); } else if ((Nazwa == null || Nazwa.Equals("")) && (IdMarki == null || Model.Equals(""))) { return("produkt musi posiadać cechy"); } return(""); } catch (Exception ex) {; log.Error(ex); throw ex; } }
/// <summary> /// Определяет, равны ли значения этого экземпляра и указанного объекта MainRepository.Models.CarModels /// </summary> /// <param name="obj">Объект для сравнения с данным экземпляром.</param> /// <returns>true, если значение параметра obj совпадает со значением данного экземпляра; /// в противном случае — false. Если значением параметра obj является null, метод возвращает false.</returns> public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } var carModel = obj as CarModel; return (CarNumber.Equals(carModel.CarNumber) && Model.Equals(carModel.Model) && ManufacturedYear.Equals(carModel.ManufacturedYear) && CarCost.Equals(carModel.CarCost) && EnginePower.Equals(carModel.EnginePower)); }
public override bool Equals(object obj) { if (ReferenceEquals(obj, this)) { return(true); } var entity = obj as IPersistEntity; if (entity == null) { return(false); } return(EntityLabel.Equals(entity.EntityLabel) && Model.Equals(entity.Model)); }
public void SetModel(Model newModel) { if (newModel == null) { return; } if (currentModel != null && newModel.Equals(currentModel)) { return; } currentModel = newModel; name.text = currentModel.name; foreach (var icon in icons) { icon.gameObject.SetActive(currentModel.iconIds.Contains(icon.iconId)); } if (!string.IsNullOrEmpty(currentModel.description)) { description.text = currentModel.description; } else { description.text = "No description."; } minted.text = $"{currentModel.issuedId} / {currentModel.issuedTotal}"; Utils.InverseTransformChildTraversal <LayoutGroup>((x) => { RectTransform rt = x.transform as RectTransform; Utils.ForceRebuildLayoutImmediate(rt); }, transform); ethNetwork.SetActive(!currentModel.isInL2); l2Network.SetActive(currentModel.isInL2); if (gameObject.activeInHierarchy) { GetThumbnail(); } }
public bool Equals(StoredCar other) { if (other == null) { return(false); } return(Model.Equals(other.Model) && Position.Equals(other.Position) && Angle.Equals(other.Angle) && Flags.Equals(other.Flags) && Color1.Equals(other.Color1) && Color2.Equals(other.Color2) && Radio.Equals(other.Radio) && Extra1.Equals(other.Extra1) && Extra2.Equals(other.Extra2) && Bomb.Equals(other.Bomb)); }
public bool Equals(StoredCar other) { if (other == null) { return(false); } return(Model.Equals(other.Model) && Position.Equals(other.Position) && Math.Abs(Heading - other.Heading) < 0.001 && Math.Abs(Pitch - other.Pitch) < 0.001 && Traction.Equals(other.Traction) && Flags.Equals(other.Flags) && Color1.Equals(other.Color1) && Color2.Equals(other.Color2) && Radio.Equals(other.Radio) && Extra1.Equals(other.Extra1) && Extra2.Equals(other.Extra2)); }
public override bool Equals(object obj) { var itemId = obj as ItemId; if (itemId == null) { return(false); } if (Model != null ? !Model.Equals(itemId.Model) : itemId.Model != null) { return(false); } if (Producer != null ? !Producer.Equals(itemId.Producer) : itemId.Producer != null) { return(false); } if (Version != itemId.Version) { return(false); } return(true); }
public static void Enable(Usr CurrentUsr, int ParentObjectK, Model.Entities.ObjectType ParentObjectType) { if (ParentObjectType.Equals(Model.Entities.ObjectType.Thread)) { Thread t = new Thread(ParentObjectK); bool changed = false; if (t.CheckPermissionRead(CurrentUsr)) { ThreadUsr tu = t.GetThreadUsr(CurrentUsr); if (!tu.IsWatching) { tu.ChangeStatus(ThreadUsr.StatusEnum.Archived, true); changed = true; } if (changed) { UpdateTotalParticipantsJob job = new UpdateTotalParticipantsJob(); job.ExecuteAsynchronously(); } } return; } try { CommentAlert c = new CommentAlert(CurrentUsr.K, ParentObjectType, ParentObjectK); } catch { CommentAlert c = new CommentAlert(); c.UsrK = CurrentUsr.K; c.ParentObjectK = ParentObjectK; c.ParentObjectType = ParentObjectType; c.Update(); } }
public bool IsConnectedTo(Model.Entities.ObjectType objectType, int objectK) { if (objectType.Equals(Model.Entities.ObjectType.Thread) && this.K == objectK) return true; if (this.ParentDiscussable is IConnectedTo) { IConnectedTo parent = (IConnectedTo)this.ParentDiscussable; if (objectType.Equals(this.ParentObjectType) && this.ParentObjectK == objectK) return true; if (parent.CanBeConnectedTo(objectType) && parent.IsConnectedTo(objectType, objectK)) return true; } return false; }
/// <summary> /// ����ijһ����ָ��Id�ķ��� /// </summary> /// <param name="sortType"></param> /// <param name="sortId"></param> /// <returns></returns> public static int UpdateInfoCount(Model.SortType sortType, long sortId) { string sortFlagName = GetSortFlagName(sortType); if (sortType.Equals("")) return 0; if (sortId <= 0) return 0; return DAL.UpdateInfoCount(sortFlagName, sortId); }
public static bool CanBeConnectedToStatic(Model.Entities.ObjectType o) { if (o.Equals(Model.Entities.ObjectType.Place)) return true; if (Place.CanBeConnectedToStatic(o)) return true; return false; }
public bool IsConnectedTo(Model.Entities.ObjectType objectType, int objectK) { if (objectType.Equals(Model.Entities.ObjectType.Venue) && this.K == objectK) return true; if (objectType.Equals(Model.Entities.ObjectType.Place) && this.PlaceK == objectK) return true; if (Place.CanBeConnectedToStatic(objectType) && this.Place.IsConnectedTo(objectType, objectK)) return true; return false; }
public static bool IsEnabled(int UsrK, int ParentObjectK, Model.Entities.ObjectType ParentObjectType) { if (ParentObjectType.Equals(Model.Entities.ObjectType.Thread)) { try { ThreadUsr tu = new ThreadUsr(ParentObjectK, UsrK); return tu.IsWatching; } catch { return false; } } try { CommentAlert c = new CommentAlert(UsrK, ParentObjectType, ParentObjectK); return true; } catch { return false; } }