public async Task <bool> OrderValidation(Order order, bool deadLineValidation) { try { var isValid = true; var deadLine = await _deadlineManager.GetDeadLineByEventId(order.EventID); if (string.IsNullOrWhiteSpace(order.Username) || string.IsNullOrWhiteSpace(order.EventID) || string.IsNullOrWhiteSpace(order.ValueA) || string.IsNullOrWhiteSpace(order.ValueB)) { isValid = false; } if (!deadLineValidation) { return(isValid); } if (deadLine < order.OrderSubmitTime) { isValid = false; } return(isValid); } catch (Exception ex) { return(false); } }
public async void TestCommitOrderSuccess() { try { var results = await _deadlineManager.GetDeadLineByEventId("TestEventId"); Assert.NotNull(results); } catch (Exception) { Assert.True(false); } }
public async Task <DateTime> GetDeadlineByEventId(string eventId) { return(await _deadlineManager.GetDeadLineByEventId(eventId)); }