ðŸŽ‰ Exercism Research is now launched. Help Exercism, help science and have some fun at research.exercism.io ðŸŽ‰

# freddie2025's solution

## to Gigasecond in the C# Track

Published at Apr 09 2019 · 0 comments
Instructions
Test suite
Solution

#### Note:

This exercise has changed since this solution was written.

Given a moment, determine the moment that would be after a gigasecond has passed.

A gigasecond is 10^9 (1,000,000,000) seconds.

## Running the tests

To run the tests, run the command `dotnet test` from within the exercise directory.

Initially, only the first test will be enabled. This is to encourage you to solve the exercise one step at a time. Once you get the first test passing, remove the `Skip` property from the next test and work on getting that test passing. Once none of the tests are skipped and they are all passing, you can submit your solution using `exercism submit Gigasecond.cs`

## Further information

For more detailed information about the C# track, including how to get help if you're having trouble, please visit the exercism.io C# language page.

## Source

Chapter 9 in Chris Pine's online Learn to Program tutorial. http://pine.fm/LearnToProgram/?Chapter=09

### GigasecondTest.cs

``````// This file was auto-generated based on version 2.0.0 of the canonical data.

using System;
using Xunit;

public class GigasecondTest
{
[Fact]
public void Date_only_specification_of_time()
{
Assert.Equal(new DateTime(2043, 1, 1, 1, 46, 40), Gigasecond.Add(new DateTime(2011, 4, 25)));
}

[Fact(Skip = "Remove to run test")]
public void Second_test_for_date_only_specification_of_time()
{
Assert.Equal(new DateTime(2009, 2, 19, 1, 46, 40), Gigasecond.Add(new DateTime(1977, 6, 13)));
}

[Fact(Skip = "Remove to run test")]
public void Third_test_for_date_only_specification_of_time()
{
Assert.Equal(new DateTime(1991, 3, 27, 1, 46, 40), Gigasecond.Add(new DateTime(1959, 7, 19)));
}

[Fact(Skip = "Remove to run test")]
public void Full_time_specified()
{
Assert.Equal(new DateTime(2046, 10, 2, 23, 46, 40), Gigasecond.Add(new DateTime(2015, 1, 24, 22, 0, 0)));
}

[Fact(Skip = "Remove to run test")]
public void Full_time_with_day_roll_over()
{
Assert.Equal(new DateTime(2046, 10, 3, 1, 46, 39), Gigasecond.Add(new DateTime(2015, 1, 24, 23, 59, 59)));
}
}``````
``````using System;

public static class Gigasecond
{
{
int gigaSecond = 1000000000;
}
}``````