Skip to content

Commit 050ac92

Browse files
author
Mohamed
committed
fix:refactor unused functions in concrete builder
1 parent 74af3ef commit 050ac92

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

designpatterns/builder/builderpattern_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package builder
22
import (
3+
"fmt"
34
"reflect"
45
"testing"
56
)
@@ -34,6 +35,18 @@ func TestBuilderPatter(t *testing.T){
3435
}
3536
})
3637

38+
t.Run("Test set builder ", func(t *testing.T) {
39+
iglooBuilder := getBuilder("igloo")
40+
director := director{}
41+
director.setBuilder(iglooBuilder)
42+
iglooHouse := director.buildHouse()
43+
fmt.Println(iglooHouse)
44+
if !reflect.DeepEqual(iglooHouse.floor, 1) {
45+
t.Errorf("got: %v, want: %v", iglooHouse.floor, 1)
46+
}
47+
48+
})
49+
3750
}
3851

3952

designpatterns/builder/director.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ func newDirector(b iBuilder) *director {
99
builder: b,
1010
}
1111
}
12-
1312
func (d *director) setBuilder(b iBuilder) {
1413
d.builder = b
1514
}

0 commit comments

Comments
 (0)