public void ValidateWhenCpuCountAtMaxAllowed() { // Arrange var sut = new StartContainerOptions(); sut.WithCpuLimit(Environment.ProcessorCount); // Act/Assert Assert.DoesNotThrow(() => sut.Validate()); }
public void ValidateWhenCpuCountValidAboveZero() { // Arrange var sut = new StartContainerOptions(); sut.WithCpuLimit(0.1m); // Act/Assert Assert.DoesNotThrow(() => sut.Validate()); }
public void WithCpuLimitSetsCpuLimit(decimal cpuLimit) { // Arrange var sut = new StartContainerOptions(); // Act sut.WithCpuLimit(cpuLimit); // Assert sut.CpuLimit.Should().Be(cpuLimit); }
public void ValidateWhenCpuCountTooLow(decimal cpuCount) { // Arrange var sut = new StartContainerOptions(); sut.WithCpuLimit(cpuCount); // Act var exception = Assert.Catch(() => sut.Validate()); // Assert exception.Should().BeOfType <ArgumentException>(); }
public void ValidateWhenCpuCountTooHigh() { // Arrange var sut = new StartContainerOptions(); sut.WithCpuLimit(Environment.ProcessorCount + 1); // Act var exception = Assert.Catch(() => sut.Validate()); // Assert exception.Should().BeOfType <ArgumentException>(); }