2 * This file is part of yosql. It is subject to the license terms in the LICENSE file found in the top-level
3 * directory of this distribution and at https://creativecommons.org/publicdomain/zero/1.0/. No part of yosql,
4 * including this file, may be copied, modified, propagated, or distributed except according to the terms contained
8 package wtf
.metio
.yosql
.codegen
.blocks
;
10 import org
.junit
.jupiter
.api
.Assertions
;
11 import org
.junit
.jupiter
.api
.BeforeEach
;
12 import org
.junit
.jupiter
.api
.DisplayName
;
13 import org
.junit
.jupiter
.api
.Test
;
15 @DisplayName("DefaultCodeBlocks")
16 class DefaultCodeBlocksTest
{
18 private CodeBlocks blocks
;
22 blocks
= new DefaultCodeBlocks();
27 Assertions
.assertEquals("""
29 """, blocks
.returnTrue().toString());
34 Assertions
.assertEquals("""
36 """, blocks
.returnFalse().toString());
40 void initializeFieldToSelf() {
41 Assertions
.assertEquals("""
43 """, blocks
.initializeFieldToSelf("name").toString());
48 Assertions
.assertEquals("""
50 """, blocks
.close("resource").toString());
55 Assertions
.assertEquals("""
57 """, blocks
.returnValue(CodeBlocks
.code("value")).toString());