public virtual void test_of_label() { TenorDateParameterMetadata test = TenorDateParameterMetadata.of(DATE, TENOR_10Y, "10 year"); assertEquals(test.Date, DATE); assertEquals(test.Tenor, TENOR_10Y); assertEquals(test.Label, "10 year"); assertEquals(test.Identifier, TENOR_10Y); }
public virtual void test_builder_incomplete() { //JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET: //ORIGINAL LINE: org.joda.beans.BeanBuilder<? extends TenorDateParameterMetadata> builder = TenorDateParameterMetadata.meta().builder(); BeanBuilder <TenorDateParameterMetadata> builder = TenorDateParameterMetadata.meta().builder(); builder.set(TenorDateParameterMetadata.meta().date(), DATE); assertThrowsIllegalArg(() => builder.build()); }
//------------------------------------------------------------------------- public virtual void coverage() { TenorDateParameterMetadata test = TenorDateParameterMetadata.of(DATE, TENOR_10Y); coverImmutableBean(test); TenorDateParameterMetadata test2 = TenorDateParameterMetadata.of(date(2014, 1, 1), TENOR_12M); coverBeanEquals(test, test2); }
//----------------------------------------------------------------------- public override bool Equals(object obj) { if (obj == this) { return(true); } if (obj != null && obj.GetType() == this.GetType()) { TenorDateParameterMetadata other = (TenorDateParameterMetadata)obj; return(JodaBeanUtils.equal(date, other.date) && JodaBeanUtils.equal(tenor, other.tenor) && JodaBeanUtils.equal(label, other.label)); } return(false); }
public virtual void test_builder_defaultLabel() { //JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET: //ORIGINAL LINE: org.joda.beans.BeanBuilder<? extends TenorDateParameterMetadata> builder = TenorDateParameterMetadata.meta().builder(); BeanBuilder <TenorDateParameterMetadata> builder = TenorDateParameterMetadata.meta().builder(); builder.set(TenorDateParameterMetadata.meta().date(), DATE); builder.set(TenorDateParameterMetadata.meta().tenor(), TENOR_10Y); TenorDateParameterMetadata test = builder.build(); assertEquals(test.Date, DATE); assertEquals(test.Tenor, TENOR_10Y); assertEquals(test.Label, "10Y"); assertEquals(test.Identifier, TENOR_10Y); }
public TenorDateParameterMetadata withTenor(Tenor tenor) { if (this.tenor.Equals(tenor)) { return(this); } if (label.Equals(this.tenor.ToString())) { return(TenorDateParameterMetadata.of(date, tenor)); } else { return(TenorDateParameterMetadata.of(date, tenor, label)); } }
public virtual void test_serialization() { TenorDateParameterMetadata test = TenorDateParameterMetadata.of(DATE, TENOR_10Y); assertSerialization(test); }