Exemplo n.º 1
0
        public async stt::Task UpdateGroupAsync()
        {
            moq::Mock <GroupService.GroupServiceClient> mockGrpcClient = new moq::Mock <GroupService.GroupServiceClient>(moq::MockBehavior.Strict);
            UpdateGroupRequest request = new UpdateGroupRequest {
                Group = new Group(),
            };
            Group expectedResponse = new Group
            {
                GroupName   = GroupName.FromProjectGroup("[PROJECT]", "[GROUP]"),
                DisplayName = "display_name137f65c2",
                ParentName  = "parent_name91315215",
                Filter      = "filtere47ac9b2",
                IsCluster   = true,
            };

            mockGrpcClient.Setup(x => x.UpdateGroupAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Group>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            GroupServiceClient client  = new GroupServiceClientImpl(mockGrpcClient.Object, null);
            Group responseCallSettings = await client.UpdateGroupAsync(request.Group, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            Group responseCancellationToken = await client.UpdateGroupAsync(request.Group, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Exemplo n.º 2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Enabled != false)
            {
                hash ^= Enabled.GetHashCode();
            }
            if (AvatarType != 0)
            {
                hash ^= AvatarType.GetHashCode();
            }
            hash ^= slot_.GetHashCode();
            if (BundleName.Length != 0)
            {
                hash ^= BundleName.GetHashCode();
            }
            if (AssetName.Length != 0)
            {
                hash ^= AssetName.GetHashCode();
            }
            if (GroupName.Length != 0)
            {
                hash ^= GroupName.GetHashCode();
            }
            if (SortOrder != 0)
            {
                hash ^= SortOrder.GetHashCode();
            }
            if (UnlockType != 0)
            {
                hash ^= UnlockType.GetHashCode();
            }
            hash ^= promoType_.GetHashCode();
            if (UnlockBadgeType != 0)
            {
                hash ^= UnlockBadgeType.GetHashCode();
            }
            if (IapSku.Length != 0)
            {
                hash ^= IapSku.GetHashCode();
            }
            if (UnlockBadgeLevel != 0)
            {
                hash ^= UnlockBadgeLevel.GetHashCode();
            }
            if (IconName.Length != 0)
            {
                hash ^= IconName.GetHashCode();
            }
            if (UnlockPlayerLevel != 0)
            {
                hash ^= UnlockPlayerLevel.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 3
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = WebApp != null?WebApp.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (Hosts != null ? Hosts.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Email != null ? Email.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (ServicePlanResourceGroup != null ? ServicePlanResourceGroup.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (SiteSlotName != null ? SiteSlotName.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (GroupName != null ? GroupName.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (WebAppEnvironmentParams != null ? WebAppEnvironmentParams.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (AzureDnsEnvironmentParams != null ? AzureDnsEnvironmentParams.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (AzureDnsZoneName != null ? AzureDnsZoneName.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (AzureDnsRelativeRecordSetName != null ? AzureDnsRelativeRecordSetName.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ UseIpBasedSsl.GetHashCode();
                hashCode = (hashCode * 397) ^ RsaKeyLength;
                hashCode = (hashCode * 397) ^ (AcmeBaseUri != null ? AcmeBaseUri.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (WebRootPath != null ? WebRootPath.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ RenewXNumberOfDaysBeforeExpiration;
                hashCode = (hashCode * 397) ^ (AuthenticationUri != null ? AuthenticationUri.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (AzureTokenAudience != null ? AzureTokenAudience.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (AzureManagementEndpoint != null ? AzureManagementEndpoint.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (AzureDefaultWebsiteDomainName != null ? AzureDefaultWebsiteDomainName.GetHashCode() : 0);
                return(hashCode);
            }
        }
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Name != null?Name.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (Type != null ? Type.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (GroupName != null ? GroupName.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Pattern != null ? Pattern.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ Required.GetHashCode();
                hashCode = (hashCode * 397) ^ ReadOnly.GetHashCode();
                hashCode = (hashCode * 397) ^ Multiple.GetHashCode();
                hashCode = (hashCode * 397) ^ MultipleLimit;
                hashCode = (hashCode * 397) ^ (Unit != null ? Unit.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (UnitLabel != null ? UnitLabel.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Context != null ? Context.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Label != null ? Label.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Options != null ? Options.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (FilterCriteria != null ? FilterCriteria.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ LimitToOptions.GetHashCode();
                hashCode = (hashCode * 397) ^ Advanced.GetHashCode();
                hashCode = (hashCode * 397) ^ StepSize;
                hashCode = (hashCode * 397) ^ Verifyable.GetHashCode();
                hashCode = (hashCode * 397) ^ (Default != null ? Default.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ Minimum;
                hashCode = (hashCode * 397) ^ Maximum;
                return(hashCode);
            }
        }
        /// <summary>
        /// Returns true if BankingAgentIdentification instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingAgentIdentification to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingAgentIdentification other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CorporationName == other.CorporationName ||
                     CorporationName != null &&
                     CorporationName.Equals(other.CorporationName)
                     ) &&
                 (
                     GroupName == other.GroupName ||
                     GroupName != null &&
                     GroupName.Equals(other.GroupName)
                 ) &&
                 (
                     IsUnderestablishment == other.IsUnderestablishment ||
                     IsUnderestablishment != null &&
                     IsUnderestablishment.Equals(other.IsUnderestablishment)
                 ));
        }
Exemplo n.º 6
0
        private void GroupDialogMultiAdd_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (DialogResult == DialogResult.Cancel)
            {
                return;
            }

            var msg = String.Empty;

            if (GroupName.Contains(Group.GroupTextDivider) || GroupName.Contains(","))
            {
                msg = String.Format("A group name can not contain a {0} or a ,", Group.GroupTextDivider);
            }
            else if (GroupCount < 1)
            {
                msg = "Need to pick how many groups to create.";
            }

            if (String.IsNullOrEmpty(msg))
            {
                return;
            }

            MessageBox.Show(msg, @"Bad Group Name or Count", MessageBoxButtons.OK);
            e.Cancel = true;
        }
Exemplo n.º 7
0
        public void GetGroup()
        {
            Mock <GroupService.GroupServiceClient> mockGrpcClient = new Mock <GroupService.GroupServiceClient>(MockBehavior.Strict);
            GetGroupRequest expectedRequest = new GetGroupRequest
            {
                GroupName = new GroupName("[PROJECT]", "[GROUP]"),
            };
            Group expectedResponse = new Group
            {
                GroupName             = new GroupName("[PROJECT]", "[GROUP]"),
                DisplayName           = "displayName1615086568",
                ParentNameAsGroupName = new GroupName("[PROJECT]", "[GROUP]"),
                Filter    = "filter-1274492040",
                IsCluster = false,
            };

            mockGrpcClient.Setup(x => x.GetGroup(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            GroupServiceClient client = new GroupServiceClientImpl(mockGrpcClient.Object, null);
            GroupName          name   = new GroupName("[PROJECT]", "[GROUP]");
            Group response            = client.GetGroup(name);

            Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemplo n.º 8
0
        public void CreateGroupRequestObject()
        {
            moq::Mock <GroupService.GroupServiceClient> mockGrpcClient = new moq::Mock <GroupService.GroupServiceClient>(moq::MockBehavior.Strict);
            CreateGroupRequest request = new CreateGroupRequest
            {
                Group        = new Group(),
                ValidateOnly = true,
                ProjectName  = gagr::ProjectName.FromProject("[PROJECT]"),
            };
            Group expectedResponse = new Group
            {
                GroupName   = GroupName.FromProjectGroup("[PROJECT]", "[GROUP]"),
                DisplayName = "display_name137f65c2",
                ParentName  = "parent_name91315215",
                Filter      = "filtere47ac9b2",
                IsCluster   = true,
            };

            mockGrpcClient.Setup(x => x.CreateGroup(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            GroupServiceClient client = new GroupServiceClientImpl(mockGrpcClient.Object, null);
            Group response            = client.CreateGroup(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemplo n.º 9
0
 public bool IsValid()
 {
     return(NumberOfInstances > 0 &&
            GroupName != null &&
            GroupName.IsValid() &&
            GroupName.IsVersionGroup() &&
            !string.IsNullOrEmpty(Name));
 }
Exemplo n.º 10
0
 public override int GetHashCode()
 {
     return(GroupName.GetHashCode()
            ^ Ip.GetHashCode()
            ^ Port.GetHashCode()
            ^ Database.GetHashCode()
            );
 }
Exemplo n.º 11
0
 //Для сортировки списков, сравнение
 //Вернет 1 если текущий объект больше, вернет 0 если равны, вернет -1 если текущий меньше
 //
 public int CompareTo(GroupData other)
 {
     if (Object.ReferenceEquals(other, null))
     {
         return(1);
     }
     return(GroupName.CompareTo(other.GroupName)); //Сравнение по смыслу имен групп
 }
Exemplo n.º 12
0
 // Sees if two conditions are equal. Case insensitivity only for groupbname,eventname,action.  Others the case is significant (variables, condition)
 public bool Equals(Condition c, StringComparison ci = StringComparison.InvariantCultureIgnoreCase)
 {
     return(GroupName.HasChars() && GroupName.Equals(c.GroupName, ci) &&          // groupname can be null
            EventName.Equals(c.EventName, ci) &&
            Action.Equals(c.Action, ci) &&
            ActionVars.ToString() == c.ActionVars.ToString() &&
            ToString(false) == c.ToString(false));
 }
Exemplo n.º 13
0
 public GroupRemovedEvent(GroupId groupId, GroupName groupName, DateTimeOffset createdAt, IEnumerable <Member> allowedMembers, UserId ownerId)
 {
     GroupId        = groupId;
     GroupName      = groupName;
     CreatedAt      = createdAt;
     AllowedMembers = allowedMembers;
     OwnerId        = ownerId;
 }
Exemplo n.º 14
0
 public int CompareTo(GroupData other)
 {
     if (ReferenceEquals(null, other))
     {
         return(1);
     }
     return(GroupName.CompareTo(other.GroupName));
 }
        public ActionResult DeleteConfirmed(int id)
        {
            GroupName groupName = db.groupNames.Find(id);

            db.groupNames.Remove(groupName);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 16
0
 public int CompareTo(GroupData other)
 {
     if (Object.ReferenceEquals(other, null))
     {
         return(1);
     }
     return(GroupName.CompareTo(other.GroupName));
 }
Exemplo n.º 17
0
 public override object ToParam()
 {
     return(new
     {
         a = AccountName.ToUpper(),
         b = GroupName.ToUpper()
     });
 }
Exemplo n.º 18
0
 internal object ToParam()
 {
     return(new
     {
         account = AccountName.ToUpper(),
         group = GroupName.ToUpper()
     });
 }
Exemplo n.º 19
0
        public bool Equals(IFfnAddress other)
        {
            if (other is GroupAddress otherGroup)
            {
                return(GroupName.Equals(otherGroup.GroupName) && Address.Equals(otherGroup.Address) && LinkedId.Equals(otherGroup.LinkedId));
            }

            return(false);
        }
Exemplo n.º 20
0
 public async Task<PostsResponse> GetPostByNameAsync(string name, string scheme = "full")
 {
     var groupIds = new GroupName()
     {
         name = name
     };
     var result = await _webManager.PostData(new Uri(Endpoints.PostByName), null, new StringContent(JsonConvert.SerializeObject(groupIds), Encoding.UTF8, "application/json"));
     return JsonConvert.DeserializeObject<PostsResponse>(result.ResultJson);
 }
 public bool IsValidRemoteRequest()
 {
     return(GroupName != null &&
            GroupName.IsVersionGroup() &&
            Contents != null &&
            Adaptor != null &&
            !string.IsNullOrEmpty(FileName) &&
            Path.GetExtension(FileName).ToLowerInvariant() == ".zip");
 }
Exemplo n.º 22
0
        public static GroupInfo GetGroupInfoFromGroupName(GroupName groupData, long qq)
        {
            var group = new GroupInfo();

            group.Name    = groupData.Name;
            group.Code    = groupData.Code;
            group.GroupId = groupData.Gid;
            group.QQNum   = qq;// WorkContext.GetState<long>(Constract.CurrentQQ);
            return(group);
        }
Exemplo n.º 23
0
    public static GarbageGroup GetGroup(GroupName name)
    {
        if (groups.ContainsKey(name))
        {
            return(groups[name]);
        }

        Debug.LogWarning($"Failed to find group with name {name}");
        return(null);
    }
Exemplo n.º 24
0
        public CoConTimer()
        {
            System.Timers.Timer t = new System.Timers.Timer(1 * 1000);   //实例化Timer类,设置间隔时间为1秒;
            t.Elapsed  += new System.Timers.ElapsedEventHandler(theout); //到达时间的时候执行事件;
            t.AutoReset = true;                                          //设置是执行一次(false)还是一直执行(true);
            t.Enabled   = true;                                          //是否执行System.Timers.Timer.Elapsed事件;
            GroupName eGroupName = new GroupName();

            iGroupNum = Enum.GetNames(eGroupName.GetType()).Length;
        }
Exemplo n.º 25
0
        public async Task <PostsResponse> GetPostByNameAsync(string name, string scheme = "full")
        {
            var groupIds = new GroupName()
            {
                name = name
            };
            var result = await _webManager.PostData(new Uri(Endpoints.PostByName), null, new StringContent(JsonConvert.SerializeObject(groupIds), Encoding.UTF8, "application/json"));

            return(JsonConvert.DeserializeObject <PostsResponse>(result.ResultJson));
        }
Exemplo n.º 26
0
        public bool isValid()
        {
            bool RValue = true;

            if (toList.Where(x => x.GroupName.ToLower() == GroupName.ToLower() && x.Id != Id).Count() > 0)
            {
                RValue = false;
            }
            return(RValue);
        }
Exemplo n.º 27
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ (GroupName != null ? GroupName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ObjectKeyName != null ? ObjectKeyName.GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemplo n.º 28
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (GroupName != null ? GroupName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (FileInfo != null ? FileInfo.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ReplicateIndexes != null ? ReplicateIndexes.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsAllGroup.GetHashCode();
         return(hashCode);
     }
 }
Exemplo n.º 29
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 17;
         hash = hash * 23 + (GroupName == null ? 0 : GroupName.GetHashCode());
         hash = hash * 23 + (ModifiedDate == default(DateTime) ? 0 : ModifiedDate.GetHashCode());
         hash = hash * 23 + (Name == null ? 0 : Name.GetHashCode());
         return(hash);
     }
 }
 /// <summary>Snippet for GetGroup</summary>
 public void GetGroup()
 {
     // Snippet: GetGroup(GroupName,CallSettings)
     // Create client
     GroupServiceClient groupServiceClient = GroupServiceClient.Create();
     // Initialize request argument(s)
     GroupName name = new GroupName("[PROJECT]", "[GROUP]");
     // Make the request
     Group response = groupServiceClient.GetGroup(name);
     // End snippet
 }
Exemplo n.º 31
0
        private bool CheckRepeat(GroupName model)
        {
            var query = Query.Or(Query <GroupName> .EQ(t => t._id, model._id),
                                 Query <GroupName> .EQ(t => t.ServiceName, model.ServiceName));
            var modelDb = _bll.Get(query);

            if (modelDb == null)
            {
                return(true);
            }
            return(model.Rid == modelDb.Rid);
        }