Beispiel #1
0
        public void TaskDto_Extension_AsEntity_NotNull()
        {
            var task   = TestHelper.TaskDto();
            var result = task.AsEntity();

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(Task));

            Assert.IsNotNull(result.Name);
            Assert.IsInstanceOfType(result.Name, typeof(string));
            Assert.AreEqual(task.Name, result.Name);

            Assert.IsNotNull(result.Description);
            Assert.IsInstanceOfType(result.Description, typeof(string));
            Assert.AreEqual(task.Description, result.Description);

            Assert.IsNotNull(result.AssignedTo);
            Assert.IsInstanceOfType(result.AssignedTo, typeof(Employee));

            Assert.IsNotNull(result.AssignedBy);
            Assert.IsInstanceOfType(result.AssignedBy, typeof(Employee));

            Assert.IsNotNull(result.EstimatedStart);
            Assert.IsInstanceOfType(result.EstimatedStart, typeof(DateTime));
            Assert.AreEqual(task.EstimatedStart, result.EstimatedStart);

            Assert.IsNotNull(result.EstimatedEnd);
            Assert.IsInstanceOfType(result.EstimatedEnd, typeof(DateTime));
            Assert.AreEqual(task.EstimatedEnd, result.EstimatedEnd);

            Assert.IsNotNull(result.ActualStart);
            Assert.IsInstanceOfType(result.ActualStart, typeof(DateTime));
            Assert.AreEqual(task.ActualStart, result.ActualStart);

            Assert.IsNotNull(result.ActualEnd);
            Assert.IsInstanceOfType(result.ActualEnd, typeof(DateTime));
            Assert.AreEqual(task.ActualEnd, result.ActualEnd);

            Assert.IsNotNull(result.Status);
            Assert.IsInstanceOfType(result.Status, typeof(TaskStatus));

            Assert.IsNotNull(result.Created);
            Assert.IsInstanceOfType(result.Created, typeof(DateTime));
            Assert.AreEqual(task.Created, result.Created);

            Assert.IsNotNull(result.CreatedBy);
            Assert.IsInstanceOfType(result.CreatedBy, typeof(User));

            Assert.IsNotNull(result.Modified);
            Assert.IsInstanceOfType(result.Modified, typeof(DateTime));
            Assert.AreEqual(task.Modified, result.Modified);

            Assert.IsNotNull(result.ModifiedBy);
            Assert.IsInstanceOfType(result.ModifiedBy, typeof(User));

            Assert.IsNotNull(result.IsActive);
            Assert.IsInstanceOfType(result.IsActive, typeof(bool));
            Assert.AreEqual(task.IsActive, result.IsActive);

            Assert.IsNotNull(result.IsDeleted);
            Assert.IsInstanceOfType(result.IsDeleted, typeof(bool));
            Assert.AreEqual(task.IsDeleted, result.IsDeleted);
        }