<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
#if !FEATURE_LEGACY_REFLECTION_API
using System.Reflection;
#endif
using Xunit;

namespace Moq.Tests
{
	public class MockFixture
	{
		[Fact]
		public void CreatesMockAndExposesInterface()
		{
			var mock = new Mock<IComparable>();

			IComparable comparable = mock.Object;

			Assert.NotNull(comparable);
		}

		[Fact]
		public void CanBeNamedForEasierDebugging()
		{
			var mock = new Mock<IComparable>();
			mock.Name = "my mock";

			Assert.Equal("my mock", mock.ToString());
		}

		[Fact]
		public void HasADefaultNameThatIsUnique()
		{
			var mock = new Mock<IComparable>();
			var mock2 = new Mock<IComparable>();

			Assert.NotEqual(mock.ToString(), mock2.ToString());
		}

		[Fact]
		public void HasADefaultNameThatIncludesItsTypeAndThatItsAMock()
		{
			var mock = new Mock<IComparable>();

			Assert.Contains("System.IComparable", mock.ToString());
			Assert.Contains("mock", mock.ToString().ToLower());
		}

#if !SILVERLIGHT
		[Fact]
		public void HasADefaultNameThatIncludesItsGenericParameters()
		{
			var mock = new Mock<Dictionary<int, string>>();

			Assert.Contains("System.Collections.Generic.Dictionary<int, string>", mock.ToString());
		}
#endif

		[Fact]
		public void PassesItsNameOnToTheResultingMockObjectWhenMockingInterfaces()
		{
			var mock = new Mock<IComparable>();

			Assert.Equal(mock.ToString() + ".Object", mock.Object.ToString());
		}

		[Fact]
		public void PassesItsNameOnToTheResultingMockObjectWhenMockingClasses()
		{
			var mock = new Mock<Foo>();

			Assert.Equal(mock.ToString() + ".Object", mock.Object.ToString());<commit_msg>Exclude a test for NetCore as the string representation for the method is different on NetCore too.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
#if !FEATURE_LEGACY_REFLECTION_API
using System.Reflection;
#endif
using Xunit;

namespace Moq.Tests
{
	public class MockFixture
	{
		[Fact]
		public void CreatesMockAndExposesInterface()
		{
			var mock = new Mock<IComparable>();

			IComparable comparable = mock.Object;

			Assert.NotNull(comparable);
		}

		[Fact]
		public void CanBeNamedForEasierDebugging()
		{
			var mock = new Mock<IComparable>();
			mock.Name = "my mock";

			Assert.Equal("my mock", mock.ToString());
		}

		[Fact]
		public void HasADefaultNameThatIsUnique()
		{
			var mock = new Mock<IComparable>();
			var mock2 = new Mock<IComparable>();

			Assert.NotEqual(mock.ToString(), mock2.ToString());
		}

		[Fact]
		public void HasADefaultNameThatIncludesItsTypeAndThatItsAMock()
		{
			var mock = new Mock<IComparable>();

			Assert.Contains("System.IComparable", mock.ToString());
			Assert.Contains("mock", mock.ToString().ToLower());
		}

#if !SILVERLIGHT && !NETCORE
		[Fact]
		public void HasADefaultNameThatIncludesItsGenericParameters()
		{
			var mock = new Mock<Dictionary<int, string>>();

			Assert.Contains("System.Collections.Generic.Dictionary<int, string>", mock.ToString());
		}
#endif

		[Fact]
		public void PassesItsNameOnToTheResultingMockObjectWhenMockingInterfaces()
		{
			var mock = new Mock<IComparable>();

			Assert.Equal(mock.ToString() + ".Object", mock.Object.ToString());
		}

		[Fact]
		public void PassesItsNameOnToTheResultingMockObjectWhenMockingClasses()
		{
			var mock = new Mock<Foo>();

			Assert.Equal(mock.ToString() + ".Object", mock.Object.ToString());
{'fraction_non_alphanumeric': 0.1292952824694234, 'fraction_numerical': 0.0011648223645894002, 'mean_word_length': 4.6683168316831685, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4477525', 'n_tokens_mistral': 1252, 'n_tokens_neox': 1085, 'n_words': 230}