background

Telerik JustMock

Mock MsCorLib Members

  • JustMock allows you to mock everything, including the .NET system types as part of mscorlib.dll or any other library or DLL.
  • Part of the fastest, most flexible and complete mocking tool for crafting unit tests.
  • Our award-winning support team is available to assist you with any issues.
Mock everything
  • Mocking MsCorLib Members Overview

    JustMock allows you to mock everything, including the .NET system types as part of mscorlib.dll or any other library or DLL. Furthermore, you can directly arrange the behavior of any system type, member or function without any additional setup.

    [TestMethod]
    public void ShouldAssertCustomValueForDateTimeNow()
    {
        // Arrange
        Mock.Arrange(() => DateTime.Now).Returns(new DateTime(1900, 4, 12));
      
        // Act
        var now = DateTime.Now;
      
        // Assert
        Assert.AreEqual(1900, now.Year);
        Assert.AreEqual(4, now.Month);
        Assert.AreEqual(12, now.Day);
    }

    Mock types of MsCorLib documentation
Next Steps