本文整理汇总了C#中Nop.Web.Models.Common.AddressModel类的典型用法代码示例。如果您正苦于以下问题:C# AddressModel类的具体用法?C# AddressModel怎么用?C# AddressModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AddressModel类属于Nop.Web.Models.Common命名空间,在下文中一共展示了AddressModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_have_error_when_company_is_null_or_empty_based_on_required_setting
public void Should_have_error_when_company_is_null_or_empty_based_on_required_setting()
{
var model = new AddressModel();
//required
var validator = new AddressValidator(_localizationService,
new AddressSettings()
{
CompanyEnabled = true,
CompanyRequired = true
});
model.Company = null;
validator.ShouldHaveValidationErrorFor(x => x.Company, model);
model.Company = "";
validator.ShouldHaveValidationErrorFor(x => x.Company, model);
//not required
validator = new AddressValidator(_localizationService,
new AddressSettings()
{
CompanyEnabled = true,
CompanyRequired = false
});
model.Company = null;
validator.ShouldNotHaveValidationErrorFor(x => x.Company, model);
model.Company = "";
validator.ShouldNotHaveValidationErrorFor(x => x.Company, model);
}
示例2: CheckoutShippingAddressModel
public CheckoutShippingAddressModel()
{
Warnings = new List<string>();
ExistingAddresses = new List<AddressModel>();
NewAddress = new AddressModel();
PickupPoints = new List<CheckoutPickupPointModel>();
}
示例3: Should_have_error_when_lastName_is_null_or_empty
public void Should_have_error_when_lastName_is_null_or_empty()
{
var model = new AddressModel();
model.LastName = null;
_validator.ShouldHaveValidationErrorFor(x => x.LastName, model);
model.LastName = "";
_validator.ShouldHaveValidationErrorFor(x => x.LastName, model);
}
示例4: Should_have_error_when_email_is_null_or_empty
public void Should_have_error_when_email_is_null_or_empty()
{
var model = new AddressModel();
model.Email = null;
_validator.ShouldHaveValidationErrorFor(x => x.Email, model);
model.Email = "";
_validator.ShouldHaveValidationErrorFor(x => x.Email, model);
}
示例5: Should_not_have_error_when_email_is_correct_format
public void Should_not_have_error_when_email_is_correct_format()
{
var validator = new AddressValidator(_localizationService, _stateProvinceService,
new AddressSettings());
var model = new AddressModel();
model.Email = "[email protected]";
validator.ShouldNotHaveValidationErrorFor(x => x.Email, model);
}
示例6: Should_not_have_error_when_lastName_is_specified
public void Should_not_have_error_when_lastName_is_specified()
{
var validator = new AddressValidator(_localizationService,
new AddressSettings());
var model = new AddressModel();
model.LastName = "Smith";
validator.ShouldNotHaveValidationErrorFor(x => x.LastName, model);
}
示例7: Should_not_have_error_when_firstName_is_specified
public void Should_not_have_error_when_firstName_is_specified()
{
var validator = new AddressValidator(_localizationService, _stateProvinceService,
new AddressSettings());
var model = new AddressModel();
model.FirstName = "John";
validator.ShouldNotHaveValidationErrorFor(x => x.FirstName, model);
}
示例8: Should_have_error_when_email_is_wrong_format
public void Should_have_error_when_email_is_wrong_format()
{
var validator = new AddressValidator(_localizationService,
new AddressSettings());
var model = new AddressModel();
model.Email = "adminexample.com";
validator.ShouldHaveValidationErrorFor(x => x.Email, model);
}
示例9: Should_have_error_when_email_is_null_or_empty
public void Should_have_error_when_email_is_null_or_empty()
{
var validator = new AddressValidator(_localizationService,
new AddressSettings());
var model = new AddressModel();
model.Email = null;
validator.ShouldHaveValidationErrorFor(x => x.Email, model);
model.Email = "";
validator.ShouldHaveValidationErrorFor(x => x.Email, model);
}
示例10: Should_have_error_when_lastName_is_null_or_empty
public void Should_have_error_when_lastName_is_null_or_empty()
{
var validator = new AddressValidator(_localizationService, _stateProvinceService,
new AddressSettings());
var model = new AddressModel();
model.LastName = null;
validator.ShouldHaveValidationErrorFor(x => x.LastName, model);
model.LastName = "";
validator.ShouldHaveValidationErrorFor(x => x.LastName, model);
}
示例11: OrderDetailsModel
public OrderDetailsModel()
{
TaxRates = new List<TaxRate>();
GiftCards = new List<GiftCard>();
Items = new List<OrderItemModel>();
OrderNotes = new List<OrderNote>();
Shipments = new List<ShipmentBriefModel>();
BillingAddress = new AddressModel();
ShippingAddress = new AddressModel();
}
示例12: OrderDetailsModel
public OrderDetailsModel()
{
TaxRates = new List<TaxRate>();
GiftCards = new List<GiftCard>();
Items = new List<OrderItemModel>();
OrderNotes = new List<OrderNote>();
Shipments = new List<ShipmentBriefModel>();
BillingAddress = new AddressModel();
ShippingAddress = new AddressModel();
CustomValues = new Dictionary<string, object>();
}
示例13: Should_not_have_error_when_faxNumber_is_not_specified
public void Should_not_have_error_when_faxNumber_is_not_specified()
{
var model = new AddressModel();
model.FaxNumber = null;
_validator.ShouldNotHaveValidationErrorFor(x => x.FaxNumber, model);
}
示例14: Should_not_have_error_when_phoneNumber_is_specified
public void Should_not_have_error_when_phoneNumber_is_specified()
{
var model = new AddressModel();
model.PhoneNumber = "123456789";
_validator.ShouldNotHaveValidationErrorFor(x => x.PhoneNumber, model);
}
示例15: Should_have_error_when_phoneNumber_is_null_or_empty
public void Should_have_error_when_phoneNumber_is_null_or_empty()
{
var model = new AddressModel();
model.PhoneNumber = null;
_validator.ShouldHaveValidationErrorFor(x => x.PhoneNumber, model);
model.PhoneNumber = "";
_validator.ShouldHaveValidationErrorFor(x => x.PhoneNumber, model);
}