Ejemplo n.º 1
0
    public void ThrowInvoiceInPeriod_Agency_Should_Not_Contain_Deleted()
    {
        //Arrange

        var agency   = new Agency();
        var invoice  = new Invoice("123", "SoftUni", 1200, Department.Incomes, new DateTime(2000, 12, 28), new DateTime(2000, 10, 28));
        var invoice2 = new Invoice("435", "SoftUni", 1200, Department.Incomes, new DateTime(2000, 12, 29), new DateTime(2000, 10, 28));
        var invoice3 = new Invoice("444", "SoftUni", 1200, Department.Incomes, new DateTime(2000, 12, 30), new DateTime(2001, 09, 28));
        var invoice4 = new Invoice("test3", "SoftUni", 1200, Department.Incomes, new DateTime(2000, 10, 28), new DateTime(2001, 10, 28));
        var invoice5 = new Invoice("test", "SoftUni", 1200, Department.Incomes, new DateTime(2000, 11, 28), new DateTime(2001, 11, 27));


        //Act

        agency.Create(invoice);
        agency.Create(invoice2);
        agency.Create(invoice3);
        agency.Create(invoice4);
        agency.Create(invoice5);

        agency.ThrowInvoiceInPeriod(new DateTime(2001, 09, 20), new DateTime(2001, 11, 27));



        //Assert

        Assert.IsFalse(agency.Contains("444"));
        Assert.IsFalse(agency.Contains("test3"));
    }
Ejemplo n.º 2
0
    public void ThrowPayed_Agency_Should_Not_Contain_Payed_Invoices()
    {
        //Arrange

        var agency   = new Agency();
        var invoice  = new Invoice("first", "SoftUni", 1200, Department.Incomes, new DateTime(2000, 12, 28), new DateTime(2003, 10, 28));
        var invoice2 = new Invoice("second", "SoftUni", 1200, Department.Incomes, new DateTime(2000, 11, 28), new DateTime(2001, 10, 28));
        var invoice3 = new Invoice("third", "SoftUni", 1200, Department.Incomes, new DateTime(2000, 10, 28), new DateTime(2001, 11, 28));


        //Act

        agency.Create(invoice);
        agency.Create(invoice2);
        agency.Create(invoice3);
        agency.PayInvoice(new DateTime(2001, 10, 28));
        agency.PayInvoice(new DateTime(2001, 11, 28));
        agency.ThrowPayed();


        //Assert

        Assert.IsFalse(agency.Contains("second"));
        Assert.IsFalse(agency.Contains("third"));
    }
Ejemplo n.º 3
0
        public bool IsValid()
        {
            if (Agency?.Length != 6)
                return false;

            if (Account.IsNullOrEmpty())
                return false;

            if (ElectronicPassword?.Length != 8)
                return false;

            return Agency.Contains("-") && Account.Contains("-");
        }
Ejemplo n.º 4
0
    public void AddInvoice_Agency_Should_Contain_New_Invoice()
    {
        //Arrange

        var agency  = new Agency();
        var invoice = new Invoice("first", "SoftUni", 1200, Department.Incomes, new DateTime(2000, 10, 28), new DateTime(2001, 10, 28));

        //Act

        agency.Create(invoice);

        //Assert

        Assert.IsTrue(agency.Contains("first"));
    }
Ejemplo n.º 5
0
    public void Contains_Should_Return_False_With_Invalid_Number()
    {
        //Arrange

        var agency  = new Agency();
        var invoice = new Invoice("first", "SoftUni", 1200, Department.Incomes, new DateTime(2000, 10, 28), new DateTime(2001, 10, 28));


        //Act

        agency.Create(invoice);

        //Assert

        Assert.IsFalse(agency.Contains("second"));
    }