Skip to content

Commit

Permalink
Fixed Create MemberCardData Serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
liguo committed Jan 7, 2019
1 parent 4503ff3 commit 496f18d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,23 @@ public void EnumStringTest()

}

/// <summary>
/// 测试值为false时也序列化出来
/// </summary>
[TestMethod]
public void FalseValueSerializeTest()
{
var obj = new Card_MemberCardData()
{
supply_balance = false,
supply_bonus = false,
};
var str = obj.ToJson();
Console.WriteLine(str);
Assert.IsTrue(str.Contains("supply_balance"));
Assert.IsTrue(str.Contains("supply_bonus"));
}

//protected Store_Location _StoreLocation = new Store_Location()
//{
// business_name = "TIT 创意园1 号店",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,14 @@ public Card_DisCountData()
public class Card_MemberCardData : BaseCardInfo
{
/// <summary>
/// 是否支持积分,填写true 或false,如填写true,积分相关字段均为必填。填写false,积分字段无需填写。储值字段处理方式相同。
/// 是否支持积分,填写true 或false,如填写true,积分相关字段均为必填。
/// 必填
/// </summary>
[JsonSetting.IgnoreValueAttribute(false)]
public bool supply_bonus { get; set; }
/// <summary>
/// 是否支持储值,填写true 或false。
/// 必填
/// </summary>
[JsonSetting.IgnoreValueAttribute(false)]
public bool supply_balance { get; set; }
/// <summary>
/// 设置为true时用户领取会员卡后系统自动将其激活,无需调用激活接口。
Expand Down

0 comments on commit 496f18d

Please sign in to comment.