コード例 #1
0
 public CommunityOperationResult RemoveCommunityMember(CommunityMemberType memberType, int relatedId)
 {
     return(new CommunityOperationResult()
     {
         IsSucceed = RandomHelper.Bool()
     });
 }
コード例 #2
0
ファイル: TopicBusiness.cs プロジェクト: jango2015/CoralSea
 public TopicOperationResult ChangeTopicStatus(int topicId, TopicStatus status)
 {
     return(new TopicOperationResult()
     {
         IsSucceed = RandomHelper.Bool(), ErrorMessage = "gaga"
     });
 }
コード例 #3
0
 public CommunityOperationResult UpdateCommunity(int communityId, CommunityInfoModel model)
 {
     return(new CommunityOperationResult()
     {
         IsSucceed = RandomHelper.Bool()
     });
 }
コード例 #4
0
 public CommunityOperationResult AddCommunityMember(CommunityMemberModel model)
 {
     return(new CommunityOperationResult()
     {
         IsSucceed = RandomHelper.Bool()
     });
 }
コード例 #5
0
ファイル: TopicBusiness.cs プロジェクト: jango2015/CoralSea
 public TopicOperationResult UpdateTopic(int topicId, TopicModel model)
 {
     return(new TopicOperationResult()
     {
         IsSucceed = RandomHelper.Bool(), ErrorMessage = "gaga"
     });
 }
コード例 #6
0
        public static IEnumerable <FakeRankOperate> CreateRankOperateList(int userId, DateTime start, DateTime end)
        {
            var count = RandomHelper.Next(100);

            while (count-- > 0)
            {
                yield return(RandomHelper.Bool() ? new FakeRankOperate(userId, start) : new FakeRankOperate(userId, end));
            }
        }
コード例 #7
0
ファイル: RandomHelper_Values.cs プロジェクト: impworks/utils
 public void Bool_returns_a_random_value()
 {
     RandomTestHelper.AtLeastOnce(() =>
     {
         var a = RandomHelper.Bool();
         var b = RandomHelper.Bool();
         return(a != b);
     });
 }
コード例 #8
0
ファイル: FakeRankInfo.cs プロジェクト: jango2015/CoralSea
 public FakeRankInfo(int id)
 {
     Id          = id;
     Type        = RandomHelper.Next();
     Name        = "Jifen" + Type;
     OnlyFirst   = RandomHelper.Bool();
     DayLimit    = RandomHelper.Next(1000);
     Step        = RandomHelper.Next(-100, 100);
     Description = "yooooo" + Name;
 }
コード例 #9
0
        public async Task UserNotLoggedIn()
        {
            var db   = DbHelper.GetEmptyTestDB();
            var user = await UserHelper.CreateInDbAsync(db);

            var deck = await DeckHelper.CreateAsync(db, user);

            using var dbContext = new MemCheckDbContext(db);
            var request = new GetRemainingCardsInLesson.Request(Guid.Empty, deck, RandomHelper.Bool(), Array.Empty <Guid>());
            await Assert.ThrowsExceptionAsync <InvalidOperationException>(async() => await new GetRemainingCardsInLesson(dbContext.AsCallContext()).RunAsync(request));
        }
コード例 #10
0
        public async Task EmptyDeck()
        {
            var db   = DbHelper.GetEmptyTestDB();
            var user = await UserHelper.CreateInDbAsync(db);

            var deck = await DeckHelper.CreateAsync(db, user, algorithmId : DefaultHeapingAlgorithm.ID);

            using var dbContext = new MemCheckDbContext(db);
            var request = new GetRemainingCardsInLesson.Request(user, deck, RandomHelper.Bool(), Array.Empty <Guid>());
            var result  = await new GetRemainingCardsInLesson(dbContext.AsCallContext(), new DateTime(2000, 1, 2)).RunAsync(request);

            Assert.AreEqual(0, result.Count);
        }
コード例 #11
0
ファイル: FakeUserInfo.cs プロジェクト: jango2015/CoralSea
 public FakeUserInfo(int id)
 {
     Id            = id;
     JobNumber     = RandomHelper.Next().ToString();
     Name          = FakeName.MakeFakeUserName();
     EntryTime     = RandomHelper.Bool() ? DateTime.Now.Subtract(TimeSpan.FromDays(RandomHelper.Next(2000))) : DateTime.Now.Subtract(TimeSpan.FromHours(RandomHelper.Next(1000)));
     Rank          = (int)DateTime.Now.Subtract(EntryTime).TotalDays * 2 + RandomHelper.Next(1000);
     Sex           = RandomHelper.Bool() ? "男" : "女";
     LastLoginTime = DateTime.Now;
     NickName      = FakeName.MakeFakeUserName();
     GroupName     = FakeName.MakeFakeGroupName();
     for (int i = 0; i < RandomHelper.Next(2, 6); i++)
     {
         Interesting.Add(FakeName.MakeFakeTag());
     }
     Signature = "yooooooooooo";
     Image     = FakeImage.MakeFakeImage();
 }
コード例 #12
0
        public FakeCommunityInfo()
        {
            CommunityId      = RandomHelper.Next(23432);
            ParentId         = RandomHelper.Bool() ? RandomHelper.Next(234) : 0;
            ParentName       = ParentId > 0 ? FakeName.MakeFakeGroupName() : "";
            Name             = FakeName.MakeFakeCommunityName();
            Image            = FakeImage.MakeFakeImage();
            MasterId         = RandomHelper.Next(23432);
            MemberCount      = RandomHelper.Next(546);
            CreateTime       = RandomHelper.Time();
            Description      = FakeContent.MakeDescription();
            LastActivityTime = RandomHelper.Time();
            CloseTime        = RandomHelper.Bool() ? RandomHelper.Time() : DateTime.MaxValue;

            int tagCount = RandomHelper.Next(10);

            for (int i = 0; i < tagCount; i++)
            {
                Tags.Add(new TagModel());
            }
        }
コード例 #13
0
        public void StartMessaging()
        {
            if (IpcMessage.Exists <TestMessage>(messageName))
            {
                IpcMessage.Delete(messageName, typeof(TestMessage));
            }

            IpcMessage msg = IpcMessage.Create <TestMessage>(messageName);

            Timer timer = new Timer((o) =>
            {
                TestMessage message = new TestMessage();
                message.Name        = "Name_".RandomLetters(4);
                message.IsMonkey    = RandomHelper.Bool();

                OutLineFormat("Setting data to:\r\n {0}", ConsoleColor.Cyan, message.PropertiesToString());
                msg.Write(message);
            }, null, 0, 1000);

            Pause();
        }
コード例 #14
0
 public bool UpdateUserInfo(UserInfoModel model)
 {
     return(RandomHelper.Bool());
 }
コード例 #15
0
 public bool AddRankOperate(RankOperateModel model)
 {
     return(RandomHelper.Bool());
 }
コード例 #16
0
 public bool UpdateRankOperate(int userId, RankOperateModel model)
 {
     return(RandomHelper.Bool());
 }
コード例 #17
0
ファイル: GlooMonkey.cs プロジェクト: dekkerb115/Bam.Net
 public GlooMonkey(string name)
 {
     Name     = name;
     Birthday = DateTime.UtcNow.Subtract(TimeSpan.FromDays(365 * RandomNumber.Between(10, 150)));
     HasTail  = RandomHelper.Bool();
 }