Skip to content

Instantly share code, notes, and snippets.

@lowenthal-jason
Created May 27, 2017 15:00
Show Gist options
  • Save lowenthal-jason/1e337c3ddd663bb05fa4adea02937f1b to your computer and use it in GitHub Desktop.
Save lowenthal-jason/1e337c3ddd663bb05fa4adea02937f1b to your computer and use it in GitHub Desktop.
using System;
namespace Prime.Services
{
public class PrimeService
{
public bool IsPrime(int candidate)
{
return candidate != 1;
}
}
}
using Xunit;
using Prime.Services;
namespace Prime.UnitTests.Services
{
public class PrimeService_IsPrimeShould
{
private readonly PrimeService _primeService;
public PrimeService_IsPrimeShould()
{
_primeService = new PrimeService();
}
[Fact]
public void ReturnFalseGivenValueOf1()
{
var result = _primeService.IsPrime(1);
Assert.False(result, $"1 should not be prime");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment