123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using Microsoft.VisualStudio.TestTools.UnitTesting;
- using System;
- using WSUniversalLib;
- namespace UnitTestorWSULib
- {
- [TestClass]
- public class UnitTest1
- {
- //1//
- [TestMethod]
- public void ResultEqualCorrect()
- {
- Assert.AreEqual(114147, Calculation.GetQuantityForProduct(3, 1, 15, 20, 45));
- }
- [TestMethod]
- public void ResultIsNotNull()
- {
- Assert.IsNotNull(Calculation.GetQuantityForProduct(3, 1, 17, 39, 15));
- }
- [TestMethod]
- public void BadResultProductEqualCorrect()
- {
- Assert.AreEqual(-1, Calculation.GetQuantityForProduct(4, 1, 20, 21, 46));
- }
- [TestMethod]
- public void IsIncorrectType()
- {
- Assert.IsNotInstanceOfType(Calculation.GetQuantityForProduct(2, 7, 19, 21, 39), typeof(double));
- }
- [TestMethod]
- public void IsCorrectType()
- {
- Assert.IsInstanceOfType(Calculation.GetQuantityForProduct(2, 7, 19, 21, 39), typeof(int));
- }
- }
- }
|