예제 #1
0
 public void TestCreateTask()
 {
     Mock<IIdentity> mock=new Mock<IIdentity>();
     mock.SetupGet(m => m.Name).Returns("UnitTest");
     MongoTaskDao dao=new MongoTaskDao(_testDb,TestCollectionName);
     dao.CreateTask(Guid.NewGuid(), TaskStatus.Created, "test tasks", "do it", Priority.High, false,
                    DateTime.UtcNow, mock.Object);
 }
예제 #2
0
        public void TestFindTaskFail()
        {
            Mock<IIdentity> mock = new Mock<IIdentity>();
            mock.SetupGet(m => m.Name).Returns("UnitTest");
            MongoTaskDao dao = new MongoTaskDao(_testDb, TestCollectionName);
            Guid taskId = Guid.NewGuid();
            dao.CreateTask(taskId, TaskStatus.Created, "test tasks", "do it", Priority.High, false,
                           DateTime.UtcNow, mock.Object);

            MongoTaskCollectionElement element;
            Assert.IsFalse(dao.TryFidnById(Guid.NewGuid(), out element));
            Assert.IsNull(element);
        }