Beispiel #1
0
        public void ServerConverterModelToEntityTest()
        {
            IServerConverter converter = new ServerConverter(LoggerFactory);

            ServerModel serverModel = new ServerModel(23, Guid.NewGuid().ToString(), Guid.NewGuid().ToString(),
                                                      TimeSpan.FromSeconds(67));

            ServerEntity actual = converter.Convert(serverModel);

            Assert.AreEqual(serverModel.Id, actual.Id);
            Assert.AreEqual(serverModel.Name, actual.Name);
            Assert.AreEqual(serverModel.Description, actual.Description);
            Assert.AreEqual(serverModel.HeartbeatLifetime, actual.HeartbeatLifetime);
        }
Beispiel #2
0
        public void ServerConverterEntityToModelTest()
        {
            IServerConverter converter = new ServerConverter(LoggerFactory);

            ServerEntity entity = new ServerEntity
            {
                Id                = 23,
                Name              = Guid.NewGuid().ToString(),
                Description       = Guid.NewGuid().ToString(),
                HeartbeatLifetime = TimeSpan.FromSeconds(5)
            };

            ServerModel actual = converter.Convert(entity);

            Assert.AreEqual(entity.Id, actual.Id);
            Assert.AreEqual(entity.Name, actual.Name);
            Assert.AreEqual(entity.Description, actual.Description);
            Assert.AreEqual(entity.HeartbeatLifetime, actual.HeartbeatLifetime);
        }