Exemple #1
0
        public void ThatShapeUnitGroupRelationshipIsBiDirectional()
        {
            var unitGroup = UnitGroupServices.WithDto(GetUnitGroupDto()).Get();
            var shape     = ShapeServices.WithDto(ShapeTestFixtures.GetValidDtoWithUnitGroups()).Get();

            Assert.AreEqual(shape, unitGroup.Shapes.First());
        }
Exemple #2
0
        public void ThatShapeWithUnitGroupsCanBeDeletedLeavingUnitGroups()
        {
            var shape = ShapeServices.WithDto(ShapeTestFixtures.GetValidDtoWithUnitGroups()).Get();

            ShapeServices.Delete(shape);
            Assert.IsNotNull(UnitGroupServices.UnitGroups.SingleOrDefault(x => x.Name == ShapeTestFixtures.GetValidDtoWithUnitGroups().UnitGroups.First().Name));
        }
Exemple #3
0
        public void ThatShapeIsAssociatedWithUnitGroup()
        {
            var unitGroup = UnitGroupServices.WithDto(GetUnitGroupDto()).Get();
            var shape     = ShapeServices.WithDto(ShapeTestFixtures.GetValidDtoWithUnitGroups()).Get();

            Assert.AreEqual(shape.UnitGroupSet.Single(p => p.Name == unitGroup.Name), unitGroup);
        }
        public ActionResult GetShapes()
        {
            var shapes = new List <ShapeDto> {
                ShapeTestFixtures.GetValidDtoWithUnitGroups()
            };

            return(this.Direct(new { success = true, data = shapes }));
        }
        public ActionResult GetShape(JObject id)
        {
            if (CheckIfIdIsEmpty(id, "id"))
            {
                return(this.Direct(new { success = false }));
            }

            var shape = ShapeTestFixtures.GetValidDtoWithUnitGroups();

            return(this.Direct(new { success = true, result = shape }));
        }
Exemple #6
0
 private UnitGroupDto GetUnitGroupDto()
 {
     return(ShapeTestFixtures.GetValidDtoWithUnitGroups().UnitGroups.First());
 }