コード例 #1
0
        public void When_the_list_of_ids_contains_repeated_items_GetCollectRequests_should_not_return_repeated_collect_requests()
        {
            IDocumentSession fakeSession = this.GetSession();
            var collectRequest1          = new CollectRequestFactory().CreateCollectRequest(fakeSession).Item2;
            var collectRequest2          = new CollectRequestFactory().CreateCollectRequest(fakeSession).Item2;

            fakeSession.SaveChanges();

            var repository     = new CollectRequestRepository(dataprovider);
            var loadedRequests = repository.GetCollectRequests(fakeSession, collectRequest1.Oid, collectRequest1.Oid, collectRequest2.Oid);

            Assert.IsNotNull(loadedRequests);
            Assert.AreEqual(1, loadedRequests.Count(x => x.Oid == collectRequest1.Oid), MORE_THAN_ONE_COLLECT_REQUEST_WAS_FOUND, collectRequest1.Oid);
            Assert.AreEqual(1, loadedRequests.Count(x => x.Oid == collectRequest2.Oid), MORE_THAN_ONE_COLLECT_REQUEST_WAS_FOUND, collectRequest2.Oid);
            Assert.AreEqual(2, loadedRequests.Count());
        }
コード例 #2
0
        public void Should_be_possible_to_get_collectRequests_By_Ids()
        {
            IDocumentSession fakeSession = this.GetSession();
            var collectRequest1          = new CollectRequestFactory().CreateCollectRequest(fakeSession).Item2;
            var collectRequest2          = new CollectRequestFactory().CreateCollectRequest(fakeSession).Item2;

            fakeSession.SaveChanges();

            var repository     = new CollectRequestRepository(dataprovider);
            var loadedRequests = repository.GetCollectRequests(fakeSession, collectRequest1.Oid, collectRequest2.Oid);

            Assert.IsNotNull(loadedRequests);
            Assert.AreEqual(2, loadedRequests.Count());
            Assert.AreEqual(1, loadedRequests.Count(x => x.Oid == collectRequest1.Oid));
            Assert.AreEqual(1, loadedRequests.Count(x => x.Oid == collectRequest2.Oid));
        }