예제 #1
0
        public async Task Add_Should_Correct_Save_Log_Item()
        {
            var logItemMessage = "Test message";

            var result = await _logController.Add(logItemMessage);

            var logItems = _repository.Get <Log>().ToArray();

            Assert.IsTrue((result as OkObjectResult).StatusCode == 200);
            Assert.IsTrue(logItems.Length == 4);
            Assert.IsTrue(logItems.Any(x => x.Message.Equals(logItemMessage)));
        }