public void ThatShapeUnitGroupRelationshipIsBiDirectional() { var unitGroup = UnitGroupServices.WithDto(GetUnitGroupDto()).Get(); var shape = ShapeServices.WithDto(ShapeTestFixtures.GetValidDtoWithUnitGroups()).Get(); Assert.AreEqual(shape, unitGroup.Shapes.First()); }
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)); }
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 })); }
private UnitGroupDto GetUnitGroupDto() { return(ShapeTestFixtures.GetValidDtoWithUnitGroups().UnitGroups.First()); }