public void Loader_Loads_All_Configurations_In_Assembly()
        {
            // Setup
            UnitTestEntity entity = new UnitTestEntity { Id = 2, Text = "Test 1234" };

            // Act
            EntityMapLoader.LoadEntityMappings();

            // Verify
            UnitTestEntityViewModel result = Mapper.Map<UnitTestEntity, UnitTestEntityViewModel>(entity);
            Assert.AreEqual(entity.Id, result.Id, "View model's ID value did not match");
            Assert.AreEqual(entity.Text, result.Text2, "View model's text value did not match");
        }
Ejemplo n.º 2
0
        public void Can_Add_New_Entities()
        {
            // setup
            UnitTestEntity entity = new UnitTestEntity();

            // Act
            _unitOfWork.UnitTestEntities.Add(entity);

            // Verify
            _unitOfWork.Commit();
            Assert.AreEqual(1, _unitOfWork.UnitTestEntities.Fetch().Where(x => x.Id == entity.Id).Count()
                            , "Repository has an incorrect number of entities");
        }
Ejemplo n.º 3
0
        public void Can_Fetch_Entities()
        {
            // Setup
            UnitTestEntity entity = new UnitTestEntity();

            _unitOfWork.UnitTestEntities.Add(entity);
            _unitOfWork.Commit();

            // Act
            UnitTestEntity result = _unitOfWork.UnitTestEntities.Fetch().Where(x => x.Id == entity.Id).Single();

            // Verify
            Assert.AreEqual(entity.Id, result.Id, "Returned entity had an incorrect Id value");
        }
        public void Loader_Loads_All_Configurations_In_Assembly()
        {
            // Setup
            UnitTestEntity entity = new UnitTestEntity {
                Id = 2, Text = "Test 1234"
            };

            // Act
            EntityMapLoader.LoadEntityMappings();

            // Verify
            UnitTestEntityViewModel result = Mapper.Map <UnitTestEntity, UnitTestEntityViewModel>(entity);

            Assert.AreEqual(entity.Id, result.Id, "View model's ID value did not match");
            Assert.AreEqual(entity.Text, result.Text2, "View model's text value did not match");
        }
Ejemplo n.º 5
0
 public RunUnitTestTask(UnitTestEntity test)
     : base(test)
 {
 }