示例#1
0
        public async Task ReceivePortalChildList_FetchChild()
        {
            list = await portal.FetchChild();

            Assert.IsTrue(list.FetchChildCalled);
            Assert.IsTrue(list.Single().FetchChildCalled);
        }
示例#2
0
        public async Task ReceivePortalChildList_CreateChild()
        {
            list = await portal.CreateChild();

            Assert.IsTrue(list.CreateChildCalled);
            Assert.IsTrue(list.Single().CreateChildCalled);
        }
示例#3
0
        public async Task ReceivePortalChildList_FetchIntCriteriaCalled()
        {
            int crit = DateTime.Now.Millisecond;

            list = await portal.FetchChild(crit);

            Assert.AreEqual(crit, list.IntCriteria);
            Assert.AreEqual(crit, list.Single().IntCriteria);
        }
示例#4
0
        public async Task ReceivePortalChildList_FetchGuidCriteriaCalled()
        {
            var crit = Guid.NewGuid();

            list = await portal.FetchChild(crit);

            Assert.AreEqual(crit, list.GuidCriteria);
            Assert.AreEqual(crit, list.Single().GuidCriteria);
        }
示例#5
0
        public async Task ReceivePortalList_CreateIntCriteriaCalled()
        {
            int crit = DateTime.Now.Millisecond;

            list = await portal.Create(crit);

            Assert.AreEqual(crit, list.IntCriteria);
            Assert.AreEqual(crit, list.Single().IntCriteria);
        }
示例#6
0
        public async Task ReceivePortalList_CreateGuidCriteriaCalled()
        {
            var crit = Guid.NewGuid();

            list = await portal.Create(crit);

            Assert.AreEqual(crit, list.GuidCriteria);
            Assert.AreEqual(crit, list.Single().GuidCriteria);
        }
示例#7
0
        public async Task ListBase_CreateAdd()
        {
            var mock = scope.Resolve <MockReceivePortalChild <IBaseObject> >();

            mock.MockPortal.Setup(x => x.CreateChild()).ReturnsAsync(scope.Resolve <IBaseObject>());

            var result = await list.CreateAdd();

            Assert.IsTrue(list.Count == 1);
            Assert.AreSame(result, list.Single());

            mock.MockPortal.Verify(x => x.CreateChild(), Times.Once);
        }