generated from VLADIMIR/template
fix
This commit is contained in:
@@ -9,8 +9,15 @@ type Place struct {
|
||||
Name string `json:"name"`
|
||||
Text string `json:"text"`
|
||||
Applications []*Application `json:"applications,omitempty"`
|
||||
Hidden bool `json:"hidden"`
|
||||
Doors []*Door `json:"doors"`
|
||||
}
|
||||
|
||||
type Application struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type Door struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
@@ -71,6 +71,8 @@ func (s *StoryService) GetPlace(code string) *Place {
|
||||
Name: place.Name,
|
||||
Text: s.cleaner.ClearText(place.Text),
|
||||
Applications: applications,
|
||||
Hidden: place.Hidden,
|
||||
Doors: place.Doors,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +84,37 @@ func TestStoryService_GetPlace(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "получение точки с проходами",
|
||||
story: &story_service.Story{
|
||||
Places: []*story_service.Place{
|
||||
{
|
||||
Code: "Ы-1",
|
||||
Name: "Название",
|
||||
Text: "Текст",
|
||||
Doors: []*story_service.Door{
|
||||
{
|
||||
Code: "Ы-2",
|
||||
Name: "Приложение",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
code: "Ы-1",
|
||||
want: &story_service.Place{
|
||||
Code: "Ы-1",
|
||||
Name: "Название",
|
||||
Text: "Текст",
|
||||
Applications: []*story_service.Application{},
|
||||
Doors: []*story_service.Door{
|
||||
{
|
||||
Code: "Ы-2",
|
||||
Name: "Приложение",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user