public IReadOnlyBooleanState Visible() { Exists().ShouldBeTrue(); const string unexpectedlyFalse = "{0} should be visible but is not because {1} is marked display: none ."; const string unexpectedlyTrue = "{0} should not be visible but is."; var visibility = IsDisplayed(Element); string parent; if (visibility.Value != null) { parent = "its parent tag " + visibility.Value; } else { parent = "it"; } var unexpectedlyTrueMessage = String.Format(unexpectedlyTrue, HowFound); var unexpectedlyFalseMessage = String.Format(unexpectedlyFalse, HowFound, parent); var result = new BooleanState(unexpectedlyFalseMessage, unexpectedlyTrueMessage, () => visibility.Key); return(result); }
public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); try { TField field; await iprot.ReadStructBeginAsync(cancellationToken); while (true) { field = await iprot.ReadFieldBeginAsync(cancellationToken); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.I32) { ControlState = (SquareFeatureControlState)await iprot.ReadI32Async(cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 2: if (field.Type == TType.I32) { BooleanValue = (BooleanState)await iprot.ReadI32Async(cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; } await iprot.ReadFieldEndAsync(cancellationToken); } await iprot.ReadStructEndAsync(cancellationToken); } finally { iprot.DecrementRecursionDepth(); } }
public IReadOnlyBooleanState Exists() { const string unexpectedlyFalse = "{0} does not exist but should."; const string unexpectedlyTrue = "{0} exists but should not."; var unexpectedlyTrueMessage = String.Format(unexpectedlyTrue, HowFound); var unexpectedlyFalseMessage = String.Format(unexpectedlyFalse, HowFound); var result = new BooleanState(unexpectedlyFalseMessage, unexpectedlyTrueMessage, () => ElementExists); return(result); }
public IReadOnlyBooleanState Enabled() { const string unexpectedlyFalse = "{0} is not enabled but should be."; const string unexpectedlyTrue = "{0} is enabled but should not be."; string unexpectedlyTrueMessage = String.Format(unexpectedlyTrue, HowFound); string unexpectedlyFalseMessage = String.Format(unexpectedlyFalse, HowFound); var result = new BooleanState(unexpectedlyFalseMessage, unexpectedlyTrueMessage, () => Element.Enabled); return(result); }
//// ReSharper disable MemberCanBeProtected.Global public IReadOnlyBooleanState Enabled() //// ReSharper restore MemberCanBeProtected.Global { const string unexpectedlyFalse = "{0} is not enabled but should be."; const string unexpectedlyTrue = "{0} is enabled but should not be."; var unexpectedlyTrueMessage = String.Format(unexpectedlyTrue, HowFound); var unexpectedlyFalseMessage = String.Format(unexpectedlyFalse, HowFound); var result = new BooleanState(unexpectedlyFalseMessage, unexpectedlyTrueMessage, () => Element.Enabled); return(result); }
public void Read(TProtocol iprot) { iprot.IncrementRecursionDepth(); try { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.I32) { ControlState = (SquareFeatureControlState)iprot.ReadI32(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 2: if (field.Type == TType.I32) { BooleanValue = (BooleanState)iprot.ReadI32(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); } finally { iprot.DecrementRecursionDepth(); } }