time_set_test.go 860 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package mhayaTime
  2. import (
  3. "testing"
  4. )
  5. func TestMhayaTime_SetYear(t *testing.T) {
  6. now := Now()
  7. now.SetYear(2012)
  8. t.Logf("result = %v", now.ToDateTimeFormat())
  9. }
  10. func TestMhayaTime_SetMonth(t *testing.T) {
  11. now := Now()
  12. now.SetMonth(12)
  13. t.Logf("result = %v", now.ToDateTimeFormat())
  14. }
  15. func TestMhayaTime_SetDay(t *testing.T) {
  16. now := Now()
  17. now.SetDay(12)
  18. t.Logf("result = %v", now.ToDateTimeFormat())
  19. }
  20. func TestMhayaTime_SetHour(t *testing.T) {
  21. now := Now()
  22. now.SetHour(0)
  23. t.Logf("result = %v", now.ToDateTimeFormat())
  24. }
  25. func TestMhayaTime_SetMinute(t *testing.T) {
  26. now := Now()
  27. now.SetMinute(0)
  28. t.Logf("result = %v", now.ToDateTimeFormat())
  29. }
  30. func TestMhayaTime_SetSecond(t *testing.T) {
  31. now := Now()
  32. now.SetSecond(59)
  33. t.Logf("result = %v", now.ToDateTimeFormat())
  34. now.SetSecond(60)
  35. t.Logf("result = %v", now.ToDateTimeFormat())
  36. }