Esempio n. 1
0
        public void IsPrime_ValuesAreNotPrime_ReturnFalse(int value)
        {
            PrimeService primeService = CreatePrimeService();
            var          result       = primeService.IsPrime(value);

            Assert.IsFalse(result, $"{value} should not be prime");
        }
Esempio n. 2
0
        public void IsPrime_ValueIs0_ReturnsFalse()
        {
            var  primeService = new PrimeService();
            bool result       = primeService.IsPrime(0);

            Assert.False(result);
        }
Esempio n. 3
0
        public void IsPrime_InputIsTrue_ReturnTrue(int value)
        {
            PrimeService primeService = CreatePrimeService();
            var          result       = primeService.IsPrime(value);

            Assert.IsTrue(result, $"{value} should not be prime");
        }
        public void IsPrime_ValuesLessThan2_ReturnFalse(int value)
        {
            PrimeService primeService = CreatePrimeService();
            var          result       = primeService.IsPrime(1);

            Assert.IsFalse(result, "1 should not be prime");
        }
 public void IsPrime_InputList_ReturnTrue()
 {
     ulong [] knownPrimes = new ulong[] { 18351495660265916411, 0xFF3F3176F0042401, 0xE3ED255CA44292AD, 7, 11, 13 };
     foreach (ulong prime in knownPrimes)
     {
         var result = PrimeService.IsPrime(prime);
         Assert.True(result, $"{prime} should be prime");
     }
 }
Esempio n. 6
0
 public AppTest()
 {
     _primeService = new PrimeService();
 }
Esempio n. 7
0
 public PrimeService_IsPrimeShould()
 {
     _primeService = new PrimeService();
     Console.WriteLine("PrimeService_IsPrimeShould()");
 }
        public void IsPrime_InputIs65537_ReturnTrue()
        {
            var result = PrimeService.IsPrime(65537);

            Assert.True(result, "65537 should be prime");
        }
        public void IsPrime_InputIs3_ReturnTrue()
        {
            var result = PrimeService.IsPrime(3);

            Assert.True(result, "3 should be prime");
        }
Esempio n. 10
0
 public TestPrime()
 {
     _primeService = new PrimeService();
 }
 public void Setup()
 {
     _sut = new PrimeService();
 }
Esempio n. 12
0
 public PrimeService_IsPrimeCould2()
 {
     _primeService = new PrimeService();
 }
Esempio n. 13
0
 public PrimeServiceIsPrimeShould()
 {
     primeService = new PrimeService();
 }