
function tests = assemble_opTest()
    tests = functiontests(localfunctions);
end

function TestAssemble_op(testCase)
m = 10;
op = sbp.D2Standard(m,{0 1},4);
h = op.h;

boundary_block = op.D1(1:4,1:6)*h;
inner = op.D1(5,3:7)*h;
D1_new = assemble_op(inner,boundary_block,m)/h;

verifyEqual(testCase,D1_new,op.D1,'AbsTol',1e-10)

end

function TestAssembleD1(testCase)
m = 10;
op = sbp.D2Standard(m,{0 3},2);
h = op.h;

[D1,e_l,e_r] = assemble_D1('D1_standard_2',h,m);

verifyEqual(testCase,D1,op.D1,'AbsTol',1e-10)
verifyEqual(testCase,e_l,op.e_l,'AbsTol',1e-10)
verifyEqual(testCase,e_r,op.e_r,'AbsTol',1e-10)
end


function TestAssembleD2(testCase)
m = 10;
op = sbp.D2Standard(m,{0 3},2);
h = op.h;

[D2,e_l,e_r,d1_l,d1_r] = assemble_D2('D2_standard_2',h,m);

verifyEqual(testCase,D2,op.D2,'AbsTol',1e-10)
verifyEqual(testCase,e_l,op.e_l,'AbsTol',1e-10)
verifyEqual(testCase,e_r,op.e_r,'AbsTol',1e-10)
verifyEqual(testCase,d1_l,op.d1_l,'AbsTol',1e-10)
verifyEqual(testCase,d1_r,op.d1_r,'AbsTol',1e-10)
end
