public void WithType_InvalidComponentType_ShouldThrowArgumentException() { //Arrange const ComponentType newType = (ComponentType)2345678; Assert.That(() => DefaultComponent.WithType(newType), Throws.ArgumentException); }
public void WithType_ValidComponentType_ShouldSetTypeProperty() { //Arrange const ComponentType newType = ComponentType.Motherboard; Assert.That(DefaultComponent.Type, Is.Not.EqualTo(newType)); DefaultComponent.WithType(newType); //Assert Assert.That(DefaultComponent.Type, Is.EqualTo(newType)); }