public void GetTest() { var con = new PenaltyController(); var response = con.Get(); Assert.AreEqual(response.StatusCode, System.Net.HttpStatusCode.OK); }
public void DeleteTest() { var con = new PenaltyController(); var response = con.Delete(100); Assert.AreEqual(response.StatusCode, System.Net.HttpStatusCode.NotFound); Assert.Fail(); }
private void Awake() { instance = instance ? instance : this; DontDestroyOnLoad(this); }
public static void GetPenaltyFor(BuySellDoc buySellDoc, decimal saleAmountToBePenalized) { PenaltyController penaltyController = new PenaltyController(); //throw new NotImplementedException(); }
private void createPenaltyTrx(BuySellDoc bsd, Person systemPerson, string reason) { PersonPayingPenalty ppp; IPenaltyClass penalty = PenaltyController.GetPenalty(bsd, out ppp); if (penalty.IsNull()) { return; } //we want to delete the maximum commission. //payments will be made to people who exist. //balance will go to the system decimal totalPaymentAmount = penalty.PenaltyAmount(); if (totalPaymentAmount == 0) { return; } switch (bsd.BuySellDocStateModifierEnum) { case BuySellDocStateModifierENUM.Unknown: break; case BuySellDocStateModifierENUM.Reject: break; case BuySellDocStateModifierENUM.Cancel: break; case BuySellDocStateModifierENUM.Accept: break; case BuySellDocStateModifierENUM.SeeAddress: if (bsd.BuySellDocumentTypeEnum == BuySellDocumentTypeENUM.Sale) { bsd.IsShowFullAddressTo_Seller = true; } if (bsd.BuySellDocumentTypeEnum == BuySellDocumentTypeENUM.Purchase) { bsd.IsShowFullAddressTo_Customer = true; } break; case BuySellDocStateModifierENUM.OptOutOfSystem: { if (bsd.BuySellDocumentTypeEnum != BuySellDocumentTypeENUM.Purchase) { return; } if (bsd.BuySellDocStateEnum != BuySellDocStateENUM.RequestUnconfirmed) { return; } bsd.OptedOutOfSystem.SetToTodaysDate(UserName, UserId); } break; default: break; } calculateAndDistributePenaltyPayments_Controller(bsd, systemPerson, ppp, penalty, totalPaymentAmount); createAndSavePenalty(bsd, reason, ppp, totalPaymentAmount, GetGlobalObject()); //if (bsd.BuySellDocStateModifierEnum == BuySellDocStateModifierENUM.Cancel || bsd.BuySellDocStateModifierEnum == BuySellDocStateModifierENUM.SeeAddress) //{ //PersonPayingPenalty ppp; //IPenaltyClass penalty = PenaltyController.GetPenalty(bsd, out ppp); //if (penalty.IsNull()) // return; ////we want to delete the maximum commission. ////payments will be made to people who exist. ////balance will go to the system //decimal totalPaymentAmount = penalty.PenaltyAmount(); //if (totalPaymentAmount == 0) // return; //get all the persons involved //create a cash transaction //here we should know who is paying //if(bsd.BuySellDocStateModifierEnum == BuySellDocStateModifierENUM.SeeAddress) //{ // //update the bsd // ControllerCreateEditParameter parm = new ControllerCreateEditParameter(); // parm.Entity = bsd as ICommonWithId; // if (bsd.BuySellDocumentTypeEnum == BuySellDocumentTypeENUM.Sale) // { // bsd.IsShowFullAddressTo_Seller = true; // parm.GlobalObject = GetGlobalObject(); // //for some reason I am losing the value of bsd.BuySellDocumentTypeEnum... it becomes // //purchase when we do GetGlobalObject. // //so I am fixing it here. // bsd.BuySellDocumentTypeEnum = BuySellDocumentTypeENUM.Sale; // BuySellDocBiz.Update(parm); // } // if (bsd.BuySellDocumentTypeEnum == BuySellDocumentTypeENUM.Purchase) // { // parm.GlobalObject = GetGlobalObject(); // bsd.IsShowFullAddressTo_Customer = true; // //for some reason I am losing the value of bsd.BuySellDocumentTypeEnum... it becomes // //purchase when we do GetGlobalObject. // //so I am fixing it here. // bsd.BuySellDocumentTypeEnum = BuySellDocumentTypeENUM.Purchase; // BuySellDocBiz.Update(parm); // } //} //calculateAndDistributePenaltyPayments_Controller(bsd, systemPerson, ppp, penalty, totalPaymentAmount); //createAndSavePenalty(bsd, reason, ppp, totalPaymentAmount, GetGlobalObject()); //} }