@isTest
private class NewQuoteDevideControllerTest {

	@isTest static void test_init() {
        Account user = new Account(
            Name = '*',
            FacilityName__c = 'user',
            PostCode__c = '123456'
        );
        insert user;

        Opportunity opp = new Opportunity(
            Name = 'test opp',
            AccountId = user.Id,
            StageName = 'Prospect Created',
            CurrencyIsoCode = 'CNY',
            ProductSegment__c = 'IE',
            CloseDate = Date.today(),
            NewInquiryDate__c = Date.today().addDays(-2),
            ExpectedOrderDate__c = Date.today().addDays(2),
            TradeType__c = 'Taxation',
            SalesChannel__c = 'direct',
            Machine_Parts__c = 'Machine'
        );
        insert opp;

        Quote quo = new Quote(
            Name = 'quo',
            OpportunityId = opp.Id,
            SetName1__c = 'setname01',
            SetQty1__c = 1
        );
        insert quo;

        Quote quo2 = new Quote(
            Name = 'quo',
            OpportunityId = opp.Id,
            SetName1__c = 'setname01',
            SetQty1__c = 1,
            Quote_Type__c = 'service'
        );
        insert quo2;

		PageReference page = new PageReference('/apex/NewQuoteDevide?oppid=' + opp.Id + '&openType=');
        System.Test.setCurrentPage(page);
        NewQuoteDevideController controller = new NewQuoteDevideController();

        controller.init();

        PageReference page2 = new PageReference('/apex/NewQuoteDevide?oppid=' + opp.Id + '&openType=service');
        System.Test.setCurrentPage(page2);
        NewQuoteDevideController controller2 = new NewQuoteDevideController();

        controller2.init();

        PageReference page3 = new PageReference('/apex/NewQuoteDevide?id=' + quo.Id);
        System.Test.setCurrentPage(page3);
        NewQuoteDevideController controller3 = new NewQuoteDevideController();

        controller3.init();

        PageReference page4 = new PageReference('/apex/NewQuoteDevide?id=' + quo2.Id);
        System.Test.setCurrentPage(page4);
        NewQuoteDevideController controller4 = new NewQuoteDevideController();

        controller4.init();
	}

}