public void Validate_default() { FormDto dto = new FormDto(); var result = dto.Validate(null); Assert.True(result.Count() > 0); }
public void Validate_Default_FormDto() { FormDto dto = new FormDto(); var result = dto.Validate(null); Assert.True(0 < result.Count()); }
public void ShouldhaveError_Validate_When_AllData_Null() { FormDto dto = new FormDto(); var result = dto.Validate(null); Assert.True(0 < result.Count()); }
public void ShouldHaveNoError_Validate_Data() { FormDto dto = new FormDto() { Id = 1, Type = "Tanpa Nomor VB", Currency = new CurrencyDto() { Id = 1, Code = "Code" }, Date = DateTimeOffset.Now, SuppliantUnit = new UnitDto() { Id = 1, Code = "code", Division = new DivisionDto() { Id = 1, Code = "Code", Name = "Name", }, Name = "Name", VBDocumentLayoutOrder = 1 }, VBRequestDocument = new VBRequestDocumentDto() { Id = 1 }, Items = new List <FormItemDto>() { new FormItemDto() { UnitPaymentOrder = new UnitPaymentOrderDto() { Id = 1, Amount = 1, Date = DateTimeOffset.Now, IncomeTax = new IncomeTaxDto() { Id = 1, Name = "Name", Rate = 1 }, IncomeTaxBy = "supplier", No = "1", UseIncomeTax = true, UseVat = true } } } }; var result = dto.Validate(null); Assert.True(0 == result.Count()); }
public void ValidateFormDto_when_InvalidCode() { FormDto dto = new FormDto() { Code = "XXX" }; var result = dto.Validate(null); Assert.True(0 < result.Count()); }
public void Validate_default() { FormDto dto = new FormDto() { Items = new List <FormItemDto>() }; var result = dto.Validate(null); Assert.True(result.Count() > 0); }
public void ShouldHaveError_Validate_When_ItemsCount_Equal_Zero() { FormDto dto = new FormDto() { Items = new List <FormItemDto>() }; var result = dto.Validate(null); Assert.True(0 < result.Count()); }
public void Validate_code() { FormDto dto = new FormDto(); dto.UOMId = 0; dto.Code = "Code"; dto.CategoryId = 0; var result = dto.Validate(null); Assert.True(result.Count() > 0); }
public void ShouldHaveError_Validate_When_VBRequestDocument_Null() { FormDto dto = new FormDto() { Type = "Dengan Nomor VB", Items = new List <FormItemDto>() }; var result = dto.Validate(null); Assert.True(0 < result.Count()); }
public void ShouldHaveError_Validate_When_SuppliantUnit_and_Currency_Null() { FormDto dto = new FormDto() { Type = "Tanpa Nomor VB", SuppliantUnit = null, Currency = null, Items = new List <FormItemDto>() }; var result = dto.Validate(null); Assert.True(0 < result.Count()); }
public void ShouldHaveError_Validate_When_UnitPaymentOrder_Null() { FormDto dto = new FormDto() { Items = new List <FormItemDto>() { new FormItemDto() { UnitPaymentOrder = null } } }; var result = dto.Validate(null); Assert.True(0 < result.Count()); }
public void ShouldHaveError_Validate_When_SuppliantUnitId_and_CurrencyId_Equal_Zero() { FormDto dto = new FormDto() { Type = "Tanpa Nomor VB", SuppliantUnit = new UnitDto() { Id = 0 }, Currency = new CurrencyDto() { Id = 0 }, Items = new List <FormItemDto>() }; var result = dto.Validate(null); Assert.True(0 < result.Count()); }