Esempio n. 1
0
        public void UpdatePadSizesExistingPadSizesAreDeletedAsNeeded()
        {
            var h = new PadSeriesUpdateHandler(
                Mock.Of <IPadSeriesRepo>(),
                new Mock <PadSeriesCreateOrUpdateCompositeSpecification>(null, null, null, null, null, null).Object,
                Mock.Of <IImageProcessor>()
                );

            var existing = new PadSize[] {
                new PadSize(new Measurement(1.0f, MeasurementUnit.Inches)),
                new PadSize(new Measurement(2.0f, MeasurementUnit.Inches))
            }.ToList();

            var updates = new PadSizeCreateOrUpdate[] {
                new PadSizeCreateOrUpdate(existing[0].Id, new Measurement(1.0f, MeasurementUnit.Inches))
            }.ToList();

            var updated = h.UpdatePadSizes(existing, updates);

            Assert.AreEqual(1, updated.Count);
            Assert.AreEqual(existing[0].Id, updated[0].Id);
        }
Esempio n. 2
0
        public void UpdatePadSizesAddsNewPadSizes()
        {
            var h = new PadSeriesUpdateHandler(
                Mock.Of <IPadSeriesRepo>(),
                new Mock <PadSeriesCreateOrUpdateCompositeSpecification>(null, null, null, null, null, null).Object,
                Mock.Of <IImageProcessor>()
                );

            var existing = new PadSize[] {
                new PadSize(new Measurement(1.0f, MeasurementUnit.Inches)),
            }.ToList();

            var news = new PadSizeCreateOrUpdate[] {
                new PadSizeCreateOrUpdate(existing[0].Id, new Measurement(1.0f, MeasurementUnit.Inches), new Measurement(2.5f, MeasurementUnit.Inches)),
                new PadSizeCreateOrUpdate(null, new Measurement(4.0f, MeasurementUnit.Inches))
            }.ToList();

            var updated = h.UpdatePadSizes(existing, news);

            Assert.AreEqual(2, updated.Count);
            Assert.AreEqual(4.0f, updated[0].Diameter.Amount);
            Assert.IsNotNull(updated[0].Id);
        }
 /// <summary>
 /// Check for a ships ability to land on this station
 /// </summary>
 /// <param name="shipSize">The minimum landing pad size the ship requires</param>
 /// <returns>True, if the specified ship can land on the station</returns>
 public bool CanLand(PadSize shipSize)
 {
     return(LargestPadAvailable >= shipSize);
 }