Ejemplo n.º 1
0
        public async Task TestDurationCalculationAsync(int expected, double start, double end)
        {
            //Arrange
            ProcessingLogs processingLogs = new ProcessingLogs();
            //Act
            var res = processingLogs.CalculatDuration(start, end);

            //Assert
            Assert.AreEqual(expected, res);
        }
Ejemplo n.º 2
0
        public async Task AddObjToDBAsync(bool expected, string id)
        {
            //Arrange
            ProcessingLogs processingLogs = new ProcessingLogs();
            bool           res            = false;

            //Act
            using (var db = new LiteDatabase("mydb.db"))
            {
                var col = db.GetCollection <Target>("target");
                res = processingLogs.AddToDB(col, new Log {
                    Id = id, State = "STARTED", Timestamp = 1491377495213
                }, 5);
            }
            //Assert
            Assert.AreEqual(expected, res);
        }