コード例 #1
0
        public void SimpleTaskFactoryParsingTest(TaskSpecification taskSpecs, Model.Task expectedTask)
        {
            var parser = new TaskFactory();
            var actualTask = parser.MakeTask(taskSpecs);

            Assert.IsTrue(expectedTask.Equals(actualTask));
        }
コード例 #2
0
        /// <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)
                 ));
        }
コード例 #3
0
ファイル: Car.cs プロジェクト: gj-arrow/4-task
 protected bool Equals(Car car)
 {
     return(Make.Equals(car.Make) &&
            Model.Equals(car.Model) &&
            Year.Equals(car.Year) &&
            CharacteristicsCar.Equals(car.CharacteristicsCar));
 }
コード例 #4
0
        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));
        }
コード例 #5
0
ファイル: Service.cs プロジェクト: Hamidkn/Assignment1
    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));
        }
コード例 #7
0
 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);
 }
コード例 #8
0
 /// <inheritdoc />
 public override bool Equals(object obj)
 {
     if ((obj == null) || !(obj is ProgramDescriptionViewModel))
     {
         return(false);
     }
     return(Model.Equals(((ProgramDescriptionViewModel)obj).Model));
 }
コード例 #9
0
 public bool Equals(TabViewModel other)
 {
     if (other == null)
     {
         return(false);
     }
     return(Model.Equals(other.Model));
 }
コード例 #10
0
        public override bool Equals(object obj)
        {
            TagVM tag = obj as TagVM;

            if (tag == null)
            {
                return(false);
            }
            return(Model.Equals(tag.Model));
        }
コード例 #11
0
        public override bool Equals(object obj)
        {
            LMTimelineEventVM evt = obj as LMTimelineEventVM;

            if (evt == null)
            {
                return(false);
            }
            return(Model.Equals(evt.Model));
        }
コード例 #12
0
ファイル: AdmissionExit.cs プロジェクト: 287396159/WQWORK
 /// <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);
 }
コード例 #13
0
 public void Update(IBlePeripheral device)
 {
     if (!Model.Equals(device))
     {
         return;
     }
     Advertisement = Model.Advertisement.ToString();
     RaisePropertyChanged(nameof(Rssi));
     RaisePropertyChanged(nameof(Name));
 }
コード例 #14
0
ファイル: GuitarSpec.cs プロジェクト: hemantjangra/learnooad
 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);
 }
コード例 #15
0
ファイル: CarShopTest.cs プロジェクト: kalev1984/CarShop
        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));
        }
コード例 #16
0
ファイル: AttackableUnit.cs プロジェクト: agentran/GameServer
 public bool ChangeModel(string model)
 {
     if (Model.Equals(model))
     {
         return(false);
     }
     IsModelUpdated = true;
     Model          = model;
     return(true);
 }
コード例 #17
0
        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));
        }
コード例 #18
0
ファイル: BSForm.cs プロジェクト: stiankroknes/BlazorStrap
        // 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();
        }
コード例 #19
0
        /// <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)));
        }
コード例 #21
0
 public override bool Equals(object obj)
 {
     if (obj == null)
     {
         return(false);
     }
     if (obj.GetType() != this.GetType())
     {
         return(false);
     }
     return(Model.Equals(((ChannelViewModel)obj).Model));
 }
コード例 #22
0
        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);
        }
コード例 #23
0
        //override Equals
        public override bool Equals(object obj)
        {
            Car carObj = obj as Car;

            if (carObj == null)
            {
                return(false);
            }
            else
            {
                return(Model.Equals(carObj.Model));
            }
        }
コード例 #24
0
ファイル: CarShopTest.cs プロジェクト: kalev1984/CarShop
        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));
        }
コード例 #25
0
ファイル: BikeModel.cs プロジェクト: jacobszpz/Cyclone
        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);
        }
コード例 #26
0
        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));
        }
コード例 #27
0
ファイル: Towar.cs プロジェクト: luki501/Opportunity
 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; }
 }
コード例 #28
0
ファイル: CarModel.cs プロジェクト: AldTLT/Insurance
        /// <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));
        }
コード例 #29
0
        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));
        }
コード例 #30
0
    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();
        }
    }
コード例 #31
0
        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));
        }
コード例 #32
0
        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));
        }
コード例 #33
0
ファイル: ItemId.cs プロジェクト: zabeda/nhibernate-envers
        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);
        }
コード例 #34
0
ファイル: CommentAlert.cs プロジェクト: davelondon/dontstayin
		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();
			}
		}
コード例 #35
0
ファイル: Thread.cs プロジェクト: davelondon/dontstayin
		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;
		}
コード例 #36
0
ファイル: XYClass.cs プロジェクト: ZhaiQuan/Zhai
        /// <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);
        }
コード例 #37
0
ファイル: Venue.cs プロジェクト: davelondon/dontstayin
		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;
		}
コード例 #38
0
ファイル: Venue.cs プロジェクト: davelondon/dontstayin
		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;

		}
コード例 #39
0
ファイル: CommentAlert.cs プロジェクト: davelondon/dontstayin
		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;
			}
		}