Skip to content

Commit

Permalink
Add StartingOn and EndingOn to sub ramp interval
Browse files Browse the repository at this point in the history
  • Loading branch information
rlew421 committed Jul 18, 2023
1 parent a2c83d8 commit 55e1210
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Library/SubscriptionRampInterval.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class SubscriptionRampInterval : RecurlyEntity
public int UnitAmountInCents { get; set; }

/// <summary>Represents the date on which the ramp interval starts.</summary>
public DateTime? StartingOn { get; set; }
public DateTime StartingOn { get; set; }

/// <summary>Represents the date on which the ramp interval ends.</summary>
public DateTime? EndingOn { get; set; }
Expand Down
4 changes: 3 additions & 1 deletion Test/BaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ public List<SubscriptionRampInterval> GetMockSubscriptionRampIntervals(int numbe
var rampInterval = new SubscriptionRampInterval()
{
StartingBillingCycle = (i == 0) ? 1 : i + 2,
UnitAmountInCents = (numberOfRamps * 100) * (i + 1)
UnitAmountInCents = (numberOfRamps * 100) * (i + 1),
StartingOn = DateTime(2023,09,15),
EndingOn = DateTime(2023,09,15).AddMonths(1)
};
rampIntervals.Add(rampInterval);
}
Expand Down
4 changes: 2 additions & 2 deletions Test/SubscriptionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,8 @@ public void CreateSubscriptionWithCustomRamps()

fromService.RampIntervals[0].StartingBillingCycle.Should().Be(1);
fromService.RampIntervals[0].UnitAmountInCents.Should().Be(500);
fromService.RampIntervals[0].StartingOn.Should().Be("2024-01-12T15:38:05Z");
fromService.RampIntervals[0].EndingOn.Should().Be("2024-02-12T15:38:05Z");
fromService.RampIntervals[0].StartingOn.Should().Be("2023-09-15T00:00:00Z");
fromService.RampIntervals[0].EndingOn.Should().Be("2023-10-15T00:00:00Z");
fromService.RampIntervals[1].StartingBillingCycle.Should().Be(3);
fromService.RampIntervals[1].UnitAmountInCents.Should().Be(1000);
fromService.RampIntervals[2].StartingBillingCycle.Should().Be(4);
Expand Down

0 comments on commit 55e1210

Please sign in to comment.