Exemplo n.º 1
0
        public void FetchDirectCreditShouldBeSuccessful()
        {
            var response1 = DirectCredit.Create("012-084", "123123123", "Max Smith", 123.00m, Guid.NewGuid().ToString(), "DotNet DE", DateTime.Today);
            var response2 = DirectCredit.Find(response1.Result.ID);

            Assert.IsNotNull(response2);
            Assert.AreEqual(response1.Result.AccountName, response2.AccountName);
        }
Exemplo n.º 2
0
        public void NewDirectCreditShouldBeSuccessful()
        {
            var response = DirectCredit.Create("012-084", "123123123", "Max Smith", 123.00m, Guid.NewGuid().ToString(), "DotNet DE", DateTime.Today);

            Assert.IsTrue(response.Successful);
            Assert.IsTrue(response.Result.Successful);
            Assert.IsNotNull(((DirectCredit)response.Result).ID);

            Assert.AreEqual(((DirectCredit)response.Result).BSB, "012-084");
            Assert.IsTrue(((DirectCredit)response.Result).ID.Contains("-DC-"));
        }
Exemplo n.º 3
0
        public void DeleteDirectCreditShouldBeSuccessful()
        {
            var response1 = DirectCredit.Create("012-084", "123123123", "Max Smith", 123.00m, Guid.NewGuid().ToString(), "DotNet DE", DateTime.Today);

            Assert.IsTrue(response1.Result.Delete());
        }
Exemplo n.º 4
0
        public void InterestValue_WhenValidCreditCreated_ShouldBePercentageOfValue()
        {
            _sut = new DirectCredit(100, 5, DateTime.Now.AddDays(15).Date);

            _sut.InterestValue.ShouldBe(2);
        }
Exemplo n.º 5
0
        public void TotalValue_WhenValidCreditCreated_ShouldBeAddedInterestValue()
        {
            _sut = new DirectCredit(100, 5, DateTime.Now.AddDays(15).Date);

            _sut.TotalValue.ShouldBe(102);
        }
Exemplo n.º 6
0
        public void Validate_WhenCreditCreated(decimal value, int qtdInstallments, DateTime firstDueDate, bool expectedStatus)
        {
            _sut = new DirectCredit(value, qtdInstallments, firstDueDate);

            _sut.IsApproved.ShouldBe(expectedStatus);
        }