Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package ru.geekbrains.converter;

// Реализация интерфейса ConvertTo.
// Перевод км/ч в м/c.
public class ConvertToMetersPerSecond implements ConvertTo {
@Override
public float Do(float sourceValue) {
return sourceValue * 1000f / 3600f;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,10 @@ public void ConvertToMile_Do_UnitTest() throws Exception{
assertThat(actual, is(1.24274f));
}

@Test
public void ConvertToMetersPerSecond_Do_UnitTest() throws Exception{
ConvertTo convertTo = new ConvertToMetersPerSecond();
float actual = convertTo.Do(36);
assertThat(actual, is(10f));
}
}