using System;
using <<|=BOPROJECTNAME|>>;
using Habanero.BO;
using NUnit.Framework;
using Habanero.Testability;

namespace <<|=BOTestProjectName|>>
{
    /// <summary>
    /// Provides a place to write custom tests for <<|=CLASSNAME|>> objects.
    /// This file is only written once and can be changed.  The Def file
    /// attached to this as a dependent is rewritten with each regeneration
    /// and contains the standard tests for <<|=CLASSNAME|>>.
    /// Regenerate this test project whenever there have been changes to the
    /// business objects.
    /// If tests are failing due to a unique setup in your application,
    /// you can either override the Create methods in TestUtils, or you
    /// can add the test to the ignore list below and reimplement it here.
    /// </summary>
    public partial class Test<<|=CLASSNAME|>>
    {
        [TestFixtureSetUp]
        public void SetupTestFixture()
        {
            TestBase.SetupTestFixture();

            //------------------------------------------------------------
            // Use this list to ignore generated tests that are failing
            // due to a unique condition in your application.
            // Remember to reimplement the test here.
            //------------------------------------------------------------
            //_ignoreList.Add("TestMethodName", "Reason for ignoring it");
        }

        [SetUp]
        public void Setup()
        {
            TestBase.SetupTest();
        }
        
        [Test]
        public void Test_ToString_WhenSomePropertyNotNull_ShouldReturnSomeProperty()
        {
            //---------------Set up test pack-------------------
            BORegistry.DataAccessor = new DataAccessorInMemory();
            <<|=CLASSNAME|>> <<|=#CLASSNAME|>> = TestUtils<<|=CLASSNAME|>>.CreateUnsavedValid<<|=CLASSNAME|>>();
            //---------------Assert Precondition----------------
			//Assert.IsNotNullOrEmpty(<<|=#CLASSNAME|>>.SomeProperty);
            //---------------Execute Test ----------------------
            string toStringValue = <<|=#CLASSNAME|>>.ToString();
            //---------------Test Result -----------------------
            Assert.Fail("Implement ToString() for <<|=CLASSNAME|>> and refine this test note if you have exactly Unique"+ 
			"Constraint defined on you business object the the values from this will be used as the ToString and you do not have"+
		    "to implement ToString() on your business object. We however recommend that you always implement ToString()");
            //Assert.AreEqual(<<|=#CLASSNAME|>>.SomeProperty, toStringValue);
        }

         [Test]
           public void Test_ToString_WhenSomePropertyNull_ShouldReturnObjectID() 
		   {
            //---------------Set up test pack-------------------
            <<|=CLASSNAME|>> <<|=#CLASSNAME|>>= new <<|=CLASSNAME|>>();
            //---------------Assert Precondition----------------
            //Assert.IsNullOrEmpty(<<|=#CLASSNAME|>>.SomeProperty);
            //---------------Execute Test ----------------------
            string toStringValue = <<|=#CLASSNAME|>>.ToString();
            //---------------Test Result -----------------------
            Assert.AreEqual(<<|=#CLASSNAME|>>.ID.ToString(), toStringValue);
         }
        }
       }