コード例 #1
0
        public void CreateUserActivityLog_WithMissingUserEmail_ShoulNotInsertEntityToDatabase()
        {
            // Arrange
            const string controllerName = "SomeController";
            const string actionName     = "SomeAction";
            const string httpMethod     = "GET";

            var model = new UserActivityLogCreateModel
            {
                DateTime       = new DateTime(2000, 1, 1),
                ActionName     = actionName,
                ControllerName = controllerName,
                HttpMethod     = httpMethod
            };

            // Act
            bool result = logService.CreateUserActivityLog(model);

            // Assert
            result.Should().BeFalse();
            this.dbContext.UserActivityLogs.Should().BeEmpty();
        }