public CommunityOperationResult RemoveCommunityMember(CommunityMemberType memberType, int relatedId) { return(new CommunityOperationResult() { IsSucceed = RandomHelper.Bool() }); }
public TopicOperationResult ChangeTopicStatus(int topicId, TopicStatus status) { return(new TopicOperationResult() { IsSucceed = RandomHelper.Bool(), ErrorMessage = "gaga" }); }
public CommunityOperationResult UpdateCommunity(int communityId, CommunityInfoModel model) { return(new CommunityOperationResult() { IsSucceed = RandomHelper.Bool() }); }
public CommunityOperationResult AddCommunityMember(CommunityMemberModel model) { return(new CommunityOperationResult() { IsSucceed = RandomHelper.Bool() }); }
public TopicOperationResult UpdateTopic(int topicId, TopicModel model) { return(new TopicOperationResult() { IsSucceed = RandomHelper.Bool(), ErrorMessage = "gaga" }); }
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)); } }
public void Bool_returns_a_random_value() { RandomTestHelper.AtLeastOnce(() => { var a = RandomHelper.Bool(); var b = RandomHelper.Bool(); return(a != b); }); }
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; }
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)); }
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); }
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(); }
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()); } }
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(); }
public bool UpdateUserInfo(UserInfoModel model) { return(RandomHelper.Bool()); }
public bool AddRankOperate(RankOperateModel model) { return(RandomHelper.Bool()); }
public bool UpdateRankOperate(int userId, RankOperateModel model) { return(RandomHelper.Bool()); }
public GlooMonkey(string name) { Name = name; Birthday = DateTime.UtcNow.Subtract(TimeSpan.FromDays(365 * RandomNumber.Between(10, 150))); HasTail = RandomHelper.Bool(); }