Example #1
0
        public async Task TestCreateLogSuccess(LogType logType)
        {
            //Arrange
            var userLog = new UsersLog()
            {
                UserId      = "1",
                DateTime    = DateTime.Parse("2020-02-02"),
                Description = "test",
                LogType     = logType.ToString(),
                RoomId      = "1"
            };

            //Act
            var result = await _logDAO.CreateLog(userLog);

            var list = await context.UserLog.ToListAsync();

            var justAdded = list[0];


            //Assert
            Assert.Contains("Success", result);
            Assert.NotEmpty(list);
            Assert.Equal("1", justAdded.UserId);
            Assert.Equal(DateTime.Parse("2020-02-02"), justAdded.DateTime);
            Assert.Equal("test", justAdded.Description);
            Assert.Equal(logType.ToString(), justAdded.LogType);
            Assert.Equal("1", justAdded.RoomId);
        }