public void WithCharacteristics_ForCharacteristicIsNull_Throws( DeskCharacteristics sut) { Action action = () => sut.WithCharacteristics(DeskCharacteristicKey.GenericAccess, null !); action.Should( ) .Throw <ArgumentNullException> ( ) .WithParameter("characteristic"); }
public void ToString_ForInvoked_Instance( DeskCharacteristics sut, IGenericAccess genericAccess, IGenericAttribute genericAttribute) { sut.WithCharacteristics(DeskCharacteristicKey.GenericAccess, genericAccess); sut.WithCharacteristics(DeskCharacteristicKey.GenericAttribute, genericAttribute); using var scope = new AssertionScope( ); sut.ToString( ) .Should( ) .Contain("GenericAccess"); sut.ToString( ) .Should( ) .Contain("GenericAttribute"); }
public async Task Refresh_ForInvoked_CallsCharacteristicRefresh( DeskCharacteristics sut, IGenericAccess genericAccess, IGenericAttribute genericAttribute) { sut.WithCharacteristics(DeskCharacteristicKey.GenericAccess, genericAccess); sut.WithCharacteristics(DeskCharacteristicKey.GenericAttribute, genericAttribute); await sut.Refresh( ); using var scope = new AssertionScope( ); await genericAccess.Received( ) .Refresh( ); await genericAttribute.Received( ) .Refresh( ); }
public void WithCharacteristics_ForCharacteristic_AddsCharacteristic( DeskCharacteristics sut, IGenericAccess genericAccess) { sut.WithCharacteristics(DeskCharacteristicKey.GenericAccess, genericAccess); sut.Characteristics .Should( ) .Contain(x => x.Key == DeskCharacteristicKey.GenericAccess && x.Value == genericAccess); }