﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;

namespace Moq.Tests
{
	public class ExtensionsFixture
	{
		[Fact]
		public void IsMockeableReturnsFalseForValueType()
		{
			Assert.False(typeof(int).IsMockeable());
		}

        // [Fact]
        // public void OnceDoesNotThrowOnSecondCallIfCountWasResetBefore()
        // {
        //     var mock = new Mock<IFooReset>();
        //     mock.Setup(foo => foo.Execute("ping"))
        //         .Returns("ack")
        //         .AtMostOnce();
           
        //     Assert.Equal("ack", mock.Object.Execute("ping"));
        //     mock.ResetAllCalls();
        //     Assert.DoesNotThrow(() => mock.Object.Execute("ping"));
        // }
	}

    public interface IFooReset
    {
        object Execute(string ping);
    }
}

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;

namespace Moq.Tests
{
    public class ExtensionsFixture
    {
        #region Public Methods

        [Fact]
        public void IsMockeableReturnsFalseForValueType()
        {
            Assert.False(typeof(int).IsMockeable());
        }

        [Fact]
        public void OnceDoesNotThrowOnSecondCallIfCountWasResetBefore()
        {
            var mock = new Mock<IFooReset>();
            mock.Setup(foo => foo.Execute("ping")).Returns("ack");

            mock.Object.Execute("ping");
            mock.ResetAllCalls();
            mock.Object.Execute("ping");
            mock.Verify(o => o.Execute("ping"), Times.Once());
        }

        #endregion
    }

    public interface IFooReset
    {
        #region Public Methods

        object Execute(string ping);

        #endregion
    }
}

Fix poorly written test (sorry).
Fix poorly written test (sorry).

- test was using obsolete methods, leading to a failed build in Release mode, because of the unit test was failing.
