mirror of
https://github.com/ManyakRus/starter.git
synced 2025-11-26 23:10:42 +02:00
сделал TestStringFromBool_Rus()
This commit is contained in:
@@ -1452,6 +1452,28 @@ func StringFromBool(value bool) string {
|
|||||||
return Otvet
|
return Otvet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StringFromBool_Rus - возвращает строку из булевского значения, Да/Нет
|
||||||
|
func StringFromBool_Rus(value bool) string {
|
||||||
|
Otvet := "Да"
|
||||||
|
|
||||||
|
if value == false {
|
||||||
|
Otvet = "Нет"
|
||||||
|
}
|
||||||
|
|
||||||
|
return Otvet
|
||||||
|
}
|
||||||
|
|
||||||
|
// StringFromBool_Rus_lower - возвращает строку из булевского значения, да/нет
|
||||||
|
func StringFromBool_Rus_lower(value bool) string {
|
||||||
|
Otvet := "да"
|
||||||
|
|
||||||
|
if value == false {
|
||||||
|
Otvet = "нет"
|
||||||
|
}
|
||||||
|
|
||||||
|
return Otvet
|
||||||
|
}
|
||||||
|
|
||||||
//// UnmarshalJSON - преобразует строку время в time.Time
|
//// UnmarshalJSON - преобразует строку время в time.Time
|
||||||
//func (d *Time) UnmarshalJSON(b []byte) error {
|
//func (d *Time) UnmarshalJSON(b []byte) error {
|
||||||
// str := string(b)
|
// str := string(b)
|
||||||
|
|||||||
@@ -1353,6 +1353,20 @@ func TestStringFromBool(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestStringFromBool_Rus(t *testing.T) {
|
||||||
|
Otvet := StringFromBool_Rus(true)
|
||||||
|
if Otvet != "Да" {
|
||||||
|
t.Errorf("Expected 'Да', but got %s", Otvet)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestStringFromBool_Rus_lower(t *testing.T) {
|
||||||
|
Otvet := StringFromBool_Rus_lower(true)
|
||||||
|
if Otvet != "да" {
|
||||||
|
t.Errorf("Expected 'да', but got %s", Otvet)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//func TestTime_UnmarshalByte(t *testing.T) {
|
//func TestTime_UnmarshalByte(t *testing.T) {
|
||||||
// var Otvet Time
|
// var Otvet Time
|
||||||
// Test := []byte("10:05:01")
|
// Test := []byte("10:05:01")
|
||||||
|
|||||||
Reference in New Issue
Block a user