public void FetchPeople_ApostropheSearch_Test(string name) { using (var db = CMSDataContext.Create(DatabaseFixture.Host)) { ContextTestUtils.CreateMockHttpContext(); var m = new PeopleSearchModel(db); var p = MockPeople.CreateSavePerson(db, lastName: name); m.m.name = name.Replace("'", string.Empty); var people = m.FetchPeople().Any(); people.ShouldBeTrue(); } }
public void GetTransactionsByPeopleName(int count) { var currentPerson = MockPeople.CreateSavePerson(db); List <Transaction> transactionList = new List <Transaction>(); for (var i = 0; i < count; i++) { var transaction = MockTransactions.CreateTransaction(db, null, currentPerson.PeopleId); transactionList.Add(transaction); } Assert.Equal(count, transactionList.Count()); foreach (var item in transactionList) { MockTransactions.DeleteTransaction(db, (int)item.LoginPeopleId); } }
public void Should_GetFilteredPledgesSummary() { using (var db = CMSDataContext.Create(DatabaseFixture.Host)) { var fromDate = new DateTime(2019, 1, 1); var person = MockPeople.CreateSavePerson(db); var bundleHeader = MockContributions.CreateSaveBundle(db); var pledge = MockContributions.CreateSaveContribution( db, bundleHeader, fromDate, 200, peopleId: person.PeopleId, fundId: 1, contributionType: ContributionTypeCode.Pledge); var firstContribution = MockContributions.CreateSaveContribution(db, bundleHeader, fromDate, 100, peopleId: person.PeopleId, fundId: 1, contributionType: ContributionTypeCode.CheckCash); var secondContribution = MockContributions.CreateSaveContribution(db, bundleHeader, fromDate, 100, peopleId: person.PeopleId, fundId: 2, contributionType: ContributionTypeCode.CheckCash); var setting = MockSettings.CreateSaveSetting(db, "PostContributionPledgeFunds", "1"); var expected = MockContributions.FilteredPledgesSummary(); var actual = PledgesHelper.GetFilteredPledgesSummary(db, person.PeopleId); actual.Should().BeEquivalentTo(expected); MockContributions.DeleteAllFromBundle(db, bundleHeader); } }