public void DISABLED_OnTriggerStay(Collider col) { SwitchVolume component = col.GetComponent <SwitchVolume>(); if (component != null && CompareTag(component.Tag) && !component.OnOff) { Service.Get <EventDispatcher>().DispatchEvent(new ApplicationService.Error("VolumeSwitchError", "Volume switch {0} is off during {1}'s OnTriggerStay, and tags match.", col.name, base.name)); } }
public void Should_Throw_On_Volumes_without_Site() { var fixture = new SevenZipSettingsFixture(); var sut = new SwitchVolume(); const string expectedMessage = "Can not create volumes with size < 1"; Action result = () => { fixture.Parse(b => sut.BuildArguments(ref b)); }; result.ShouldThrow <ArgumentException>().Message.ShouldBe(expectedMessage); }
public void Volumes_without_Units_work() { var fixture = new SevenZipSettingsFixture(); var sut = new SwitchVolume { Size = 1024 }; var expected = "-v1024"; var actual = fixture.Parse(b => sut.BuildArguments(ref b)); actual.ShouldBe(expected); }
public void Volumes_with_Gigabytes_work() { var fixture = new SevenZipSettingsFixture(); var sut = new SwitchVolume { Size = 1024, Unit = VolumeUnit.Gigabytes }; const string expected = "-v1024g"; var actual = fixture.Parse(b => sut.BuildArguments(ref b)); actual.ShouldBe(expected); }
/// <summary> /// fluent setter for <see cref="ISupportSwitchVolume"/>. /// </summary> /// <typeparam name="T">the builder to support the <see cref="ISupportSwitchVolume"/>.</typeparam> /// <param name="this">The builder-instance.</param> /// <param name="size">The size.</param> /// <param name="unit">The unit.</param> /// <returns>The builder-instance for fluent re-use.</returns> public static T WithVolume <T>(this T @this, int size, VolumeUnit?unit = null) where T : ISupportSwitchBuilder <ISupportSwitchVolume> { var volume = new SwitchVolume { Size = size }; if (unit != null) { volume.Unit = unit; } if (@this.Command.Volumes == null) { @this.Command.Volumes = new SwitchVolumeCollection(volume); } else { @this.Command.Volumes.Add(volume); } return(@this); }