예제 #1
0
        public async Task DashboardItemIgnoredAnswer_Create_DoesCreate()
        {
            // Arrange
            var dashboardItemIgnoredAnswer = await DashboardHelpers.CreateDashboardItemIgnoredAnswer(DbContext);

            // Assert
            DashboardItemIgnoredAnswer dbDashboardItemIgnoredAnswer =
                DbContext.DashboardItemIgnoredAnswers.AsNoTracking().First();
            List <DashboardItemIgnoredAnswer> dashboardItemIgnoredAnswers =
                DbContext.DashboardItemIgnoredAnswers.AsNoTracking().ToList();

            Assert.NotNull(dbDashboardItemIgnoredAnswer);
            Assert.AreEqual(1, dashboardItemIgnoredAnswers.Count);

            Assert.AreEqual(dashboardItemIgnoredAnswer.Id, dbDashboardItemIgnoredAnswer.Id);
            Assert.AreEqual(1, dbDashboardItemIgnoredAnswer.Version);
            Assert.AreEqual(dashboardItemIgnoredAnswer.WorkflowState, dbDashboardItemIgnoredAnswer.WorkflowState);
            Assert.AreEqual(dashboardItemIgnoredAnswer.CreatedAt.ToString(CultureInfo.InvariantCulture),
                            dbDashboardItemIgnoredAnswer.CreatedAt.ToString(CultureInfo.InvariantCulture));
            Assert.AreEqual(dashboardItemIgnoredAnswer.CreatedByUserId, dbDashboardItemIgnoredAnswer.CreatedByUserId);
            Assert.AreEqual(dashboardItemIgnoredAnswer.UpdatedAt.ToString(),
                            dbDashboardItemIgnoredAnswer.UpdatedAt.ToString());
            Assert.AreEqual(dashboardItemIgnoredAnswer.UpdatedByUserId, dbDashboardItemIgnoredAnswer.UpdatedByUserId);
            Assert.AreEqual(dashboardItemIgnoredAnswer.AnswerId, dbDashboardItemIgnoredAnswer.AnswerId);
            Assert.AreEqual(dashboardItemIgnoredAnswer.DashboardItemId, dbDashboardItemIgnoredAnswer.DashboardItemId);
        }