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

            Assert.AreEqual(shape, unitGroup.Shapes.First());
        }
コード例 #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));
        }
コード例 #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);
        }
コード例 #4
0
        public ActionResult GetShapes()
        {
            var shapes = new List <ShapeDto> {
                ShapeTestFixtures.GetValidDtoWithUnitGroups()
            };

            return(this.Direct(new { success = true, data = shapes }));
        }
コード例 #5
0
        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 }));
        }
コード例 #6
0
 private UnitGroupDto GetUnitGroupDto()
 {
     return(ShapeTestFixtures.GetValidDtoWithUnitGroups().UnitGroups.First());
 }