コード例 #1
0
        public void WithType_InvalidComponentType_ShouldThrowArgumentException()
        {
            //Arrange
            const ComponentType newType = (ComponentType)2345678;

            Assert.That(() => DefaultComponent.WithType(newType), Throws.ArgumentException);
        }
コード例 #2
0
        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));
        }