<commit_before>using System;
using System.Reflection;
using Xunit;
using MatchGenerator.Core;
using MatchGenerator.Model;
using MatchGenerator.ViewModel;
using MatchGeneratorTest.Model;
using System.Collections.Generic;
using System.Windows.Input;

namespace MatchGeneratorTest.ViewModel
{
	/// <summary>
	/// <see cref="MemberListItemViewModel"/>のMock
	/// </summary>
	internal class MemberListItemViewModelMock : Microsoft.Practices.Prism.Mvvm.BindableBase, IMemberListItemViewModel
	{
		public IPerson ModelField = null;

		public Func<string> DescriptionGetter = () => null;
		public int DescriptionGetterCount = 0;
		public string Description
		{
			get
			{
				DescriptionGetterCount++;
				return DescriptionGetter();
			}
		}

		public Func<string> NameGetter = () => null;
		public int NameGetterCount = 0;
		public string Name
		{
			get
			{
				NameGetterCount++;
				return NameGetter();
			}
		}

		public Func<bool> IsCheckedGetter = () => false;
		public int IsCheckedGetterCount = 0;
		public Action<bool> IsCheckedSetter = _ => { };
		public int IsCheckedSetterCount = 0;
		public bool IsChecked
		{
			get
			{
				IsCheckedGetterCount++;
				return IsCheckedGetter();
			}

			set
			{
				IsCheckedSetterCount++;
				IsCheckedSetter(value);
			}
		}

		public event EventHandler<MemberClickEventArgs> MemberClick;

		public ICommand MemberClickCommand
		{
			get
			{
				throw new NotImplementedException();
			}
		}

		public event EventHandler<MemberClickEventArgs> MemberExtendedClick;

		public ICommand MemberExtendedClickCommand
		{
			get
			{
				throw new NotImplementedException();
			}
		}
	}

	public class MemberListItemViewModelTest
	{
		[Fact(DisplayName = "MemberListItemViewModelコンストラクタ : 正常系")]
		[Trait("category", "ViewModel")]
		[Trait("type", "正常系")]
		public void ConstructorTest()
		{
			// Arrange
			IPerson inputModel = new PersonMock();
			IPerson expectedModel = inputModel;

			// Act
			MemberListItemViewModel actualReturn = new MemberListItemViewModel(inputModel);

			// Assert
			// 影響するフィールドの確認
			Assert.Same(expectedModel, actualReturn.GetPrivateField("Model"));
			Assert.NotNull(actualReturn.MemberClickCommand);
			Assert.IsType<Microsoft.Practices.Prism.Commands.DelegateCommand>(actualReturn.MemberClickCommand);
		}
	}

	public class MemberListItemViewModelInstanceTest
	{
		private MemberListItemViewModel Instance;
		private IPerson ModelField;

		public MemberListItemViewModelInstanceTest()
		{
			ModelField = new PersonMock();
			Instance = new MemberListItemViewModel(ModelField);
			Instance.SetPrivateField("Model", ModelField);
		}

		[Fact(DisplayName = "Nameプロパティ : 正常系")]
		[Trait("category", "ViewModel")]
		[Trait("type", "正常系")]
		public void NameTest()
		{
			// Arrange
			string expectedName = "foobar";
			((PersonMock)ModelField).NameFunc = () => "foobar";<commit_msg>refs #23 Check a new field in a constructor test<commit_after>using System;
using System.Reflection;
using Xunit;
using MatchGenerator.Core;
using MatchGenerator.Model;
using MatchGenerator.ViewModel;
using MatchGeneratorTest.Model;
using System.Collections.Generic;
using System.Windows.Input;

namespace MatchGeneratorTest.ViewModel
{
	/// <summary>
	/// <see cref="MemberListItemViewModel"/>のMock
	/// </summary>
	internal class MemberListItemViewModelMock : Microsoft.Practices.Prism.Mvvm.BindableBase, IMemberListItemViewModel
	{
		public IPerson ModelField = null;

		public Func<string> DescriptionGetter = () => null;
		public int DescriptionGetterCount = 0;
		public string Description
		{
			get
			{
				DescriptionGetterCount++;
				return DescriptionGetter();
			}
		}

		public Func<string> NameGetter = () => null;
		public int NameGetterCount = 0;
		public string Name
		{
			get
			{
				NameGetterCount++;
				return NameGetter();
			}
		}

		public Func<bool> IsCheckedGetter = () => false;
		public int IsCheckedGetterCount = 0;
		public Action<bool> IsCheckedSetter = _ => { };
		public int IsCheckedSetterCount = 0;
		public bool IsChecked
		{
			get
			{
				IsCheckedGetterCount++;
				return IsCheckedGetter();
			}

			set
			{
				IsCheckedSetterCount++;
				IsCheckedSetter(value);
			}
		}

		public event EventHandler<MemberClickEventArgs> MemberClick;

		public ICommand MemberClickCommand
		{
			get
			{
				throw new NotImplementedException();
			}
		}

		public event EventHandler<MemberClickEventArgs> MemberExtendedClick;

		public ICommand MemberExtendedClickCommand
		{
			get
			{
				throw new NotImplementedException();
			}
		}
	}

	public class MemberListItemViewModelTest
	{
		[Fact(DisplayName = "MemberListItemViewModelコンストラクタ : 正常系")]
		[Trait("category", "ViewModel")]
		[Trait("type", "正常系")]
		public void ConstructorTest()
		{
			// Arrange
			IPerson inputModel = new PersonMock();
			IPerson expectedModel = inputModel;

			// Act
			MemberListItemViewModel actualReturn = new MemberListItemViewModel(inputModel);

			// Assert
			// 影響するフィールドの確認
			Assert.Same(expectedModel, actualReturn.GetPrivateField("Model"));
			Assert.NotNull(actualReturn.MemberClickCommand);
			Assert.IsType<Microsoft.Practices.Prism.Commands.DelegateCommand>(actualReturn.MemberClickCommand);
			Assert.NotNull(actualReturn.MemberExtendedClickCommand);
			Assert.IsType<Microsoft.Practices.Prism.Commands.DelegateCommand>(actualReturn.MemberExtendedClickCommand);
		}
	}

	public class MemberListItemViewModelInstanceTest
	{
		private MemberListItemViewModel Instance;
		private IPerson ModelField;

		public MemberListItemViewModelInstanceTest()
		{
			ModelField = new PersonMock();
			Instance = new MemberListItemViewModel(ModelField);
			Instance.SetPrivateField("Model", ModelField);
		}

		[Fact(DisplayName = "Nameプロパティ : 正常系")]
		[Trait("category", "ViewModel")]
		[Trait("type", "正常系")]
		public void NameTest()
		{
			// Arrange
			string expectedName = "foobar";
			((PersonMock)ModelField).NameFunc = () => "foobar";
{'fraction_non_alphanumeric': 0.10324433930381886, 'fraction_numerical': 0.0016897600540723217, 'mean_word_length': 4.266014234875445, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 34, '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': '259762', 'n_tokens_mistral': 2120, 'n_tokens_neox': 1776, 'n_words': 364}