Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.VisualStudio.TestTools.UnitTesting;
- using ConsoleApp.ExtMethods;
- namespace ConsoleApp
- {
- [TestClass]
- public class TestCases
- {
- [TestMethod]
- public void TestDoubleExtentions()
- {
- double v1 = 12.51367;
- double v2 = 15;
- double v3 = 0.5125;
- Assert.AreEqual(v1.IntPart(), 12);
- Assert.AreEqual(v1.FractPart(), 51367);
- Assert.AreEqual(v2.IntPart(), 15);
- Assert.AreEqual(v2.FractPart(), 0);
- Assert.AreEqual(v3.IntPart(), 0);
- Assert.AreEqual(v3.FractPart(), 5125);
- Assert.AreEqual((5678.5678).IntPart(), (5678.5678).FractPart());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement