/** * Constructs this string formula * * @param t the record * @param excelFile the excel file * @param fr the formatting record * @param es the external sheet * @param nt the workbook * @param si the sheet * @param dummy the overload indicator */ public SharedStringFormulaRecord(Record t, File excelFile, FormattingRecords fr, ExternalSheet es, WorkbookMethods nt, SheetImpl si, EmptyString dummy) : base(t, fr, es, nt, si, excelFile.getPos()) { value = string.Empty; }
public void ConvertBackThrowsException() { // Arrange var conv = new EmptyString(); // Act var ex = ExceptionAssert.Catch <NotSupportedException>(() => conv.ConvertBack(null, null, null, null)); // Assert Assert.IsNotNull(ex); }
public void StringIsHandledCorrectly() { // Arrange var conv = new EmptyString(); // Act var empty = (bool)conv.Convert(string.Empty, null, null, null); var nonEmpty = (bool)conv.Convert(" ", null, null, null); // Assert Assert.IsTrue(empty); Assert.IsFalse(nonEmpty); }
public void NonStringIsHandledCorrectly() { // Arrange var conv = new EmptyString(); // Act var nullObj = conv.Convert(null, null, null, null); var integer = conv.Convert(123, null, null, null); // Assert Assert.IsTrue((bool)nullObj); Assert.IsTrue((bool)integer); }
public static bool IsEmpty(object value1) { if (value1 == null) { return(true); } if (value1.GetType().Equals(typeof(string))) { return(EmptyString.Equals((string)value1)); } if (value1.GetType().Equals(typeof(DateTime))) { return(EmptyDate.Equals((DateTime)value1)); } if (value1.GetType().Equals(typeof(byte[]))) { return(((byte[])value1).Length == 0); } return(false); }
/** * Constructs this string formula * * @param t the record * @param excelFile the excel file * @param fr the formatting record * @param es the external sheet * @param nt the workbook * @param si the sheet * @param dummy the overload indicator */ public SharedStringFormulaRecord(Record t, File excelFile, FormattingRecords fr, ExternalSheet es, WorkbookMethods nt, SheetImpl si, EmptyString dummy) : base(t,fr,es,nt,si,excelFile.getPos()) { value = string.Empty; }
/// <summary> /// Create plain string format. /// </summary> public TextFormat() { _null = new NullString(this); _empty = new EmptyString(this); }
public virtual void Visit(EmptyString expression, T context) { }
public override void Visit(EmptyString expression, object context) { expressions.Add(expression); base.Visit(expression, context); }
public void Visit(EmptyString expression, Nonterminal context) { Add(context, expression, NullTerminal.Instance); }
/// <summary> /// Create default format. /// </summary> public CSharpFormat() { _null = new NullString(this); _empty = new EmptyString(this); }