CloneSet126


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
47220.997compilation_unit
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
1471
src/NHibernate.Test/TypesTest/DateTimeTypeFixture.cs
2471
src/NHibernate.Test/TypesTest/Decima2lTypeFixture.cs
Clone Instance
1
Line Count
47
Source Line
1
Source File
src/NHibernate.Test/TypesTest/DateTimeTypeFixture.cs

using System;
using NHibernate.Type;
using NUnit.Framework;

namespace NHibernate.Test.TypesTest
{
        /// <summary>
        /// TestFixtures for the <see cref="DateTimeType"/>.
        /// </summary>
        [TestFixture]
        public class DateTimeTypeFixture
        {
                [Test]
                public void Next()
                {
                        DateTimeType type = (DateTimeType) NHibernateUtil.DateTime;
                        object current = DateTime.Parse("2004-01-01");
                        object next = type.Next(current, null);

                        Assert.IsTrue(next is DateTime, "Next should be DateTime");
                        Assert.IsTrue((DateTime) next > (DateTime) current,
                                      "next should be greater than current (could be equal depending on how quickly this occurs)");
                }

                [Test]
                public void Seed()
                {
                        DateTimeType type = (DateTimeType) NHibernateUtil.DateTime;
                        Assert.IsTrue(type.Seed(null) is DateTime, "seed should be DateTime");
                }

                [Test]
                public void DeepCopyNotNull()
                {
                        NullableType type = NHibernateUtil.DateTime;

                        object value1 = DateTime.Now;
                        object value2 = type.DeepCopy(value1, EntityMode.Poco, null);

                        Assert.AreEqual(value1, value2, "Copies should be the same.");


                        value2 = ((DateTime)value2).AddHours(2);
                        Assert.IsFalse(value1 == value2, "value2 was changed, value1 should not have changed also.");
                }

        }
}


Clone Instance
2
Line Count
47
Source Line
1
Source File
src/NHibernate.Test/TypesTest/Decima2lTypeFixture.cs

using System;
using NHibernate.Type;
using NUnit.Framework;

namespace NHibernate.Test.TypesTest
{
    /// <summary>
    /// TestFixtures for the <see cref="DateTimeType"/>.
    /// </summary>
    [TestFixture]
    public class DateTime2TypeFixture
    {
        [Test]
        public void Next()
        {
            DateTimeType type = (DateTimeType)NHibernateUtil.DateTime2;
            object current = DateTime.Parse("2004-01-01");
            object next = type.Next(current, null);

            Assert.IsTrue(next is DateTime, "Next should be DateTime");
            Assert.IsTrue((DateTime)next > (DateTime)current,
                          "next should be greater than current (could be equal depending on how quickly this occurs)");
        }

        [Test]
        public void Seed()
        {
            DateTimeType type = (DateTimeType)NHibernateUtil.DateTime;
            Assert.IsTrue(type.Seed(null) is DateTime, "seed should be DateTime");
        }

        [Test]
        public void DeepCopyNotNull()
        {
            NullableType type = NHibernateUtil.DateTime;

            object value1 = DateTime.Now;
            object value2 = type.DeepCopy(value1, EntityMode.Poco, null);

            Assert.AreEqual(value1, value2, "Copies should be the same.");


            value2 = ((DateTime)value2).AddHours(2);
            Assert.IsFalse(value1 == value2, "value2 was changed, value1 should not have changed also.");
        }

    }
}


Clone AbstractionParameter Count: 2Parameter Bindings

using System;
using NHibernate.Type;
using NUnit.Framework;
namespace NHibernate.Test.TypesTest
{
   /// <summary>
   /// TestFixtures for the <see cref="DateTimeType"/>.
   /// </summary>
   [TestFixture]
   public class [[#variable583c5120]]
   {
      [Test]
      public void Next()
      {
         DateTimeType type = (DateTimeType)NHibernateUtil. [[#variable583c50c0]];
         object current = DateTime.Parse("2004-01-01");
         object next = type.Next(current, null);
         Assert.IsTrue(next is DateTime, "Next should be DateTime");
         Assert.IsTrue((DateTime)next > (DateTime)current, "next should be greater than current (could be equal depending on how quickly this occurs)");
      }

      [Test]
      public void Seed()
      {
         DateTimeType type = (DateTimeType)NHibernateUtil.DateTime;
         Assert.IsTrue(type.Seed(null) is DateTime, "seed should be DateTime");
      }

      [Test]
      public void DeepCopyNotNull()
      {
         NullableType type = NHibernateUtil.DateTime;
         object value1 = DateTime.Now;
         object value2 = type.DeepCopy(value1, EntityMode.Poco, null);
         Assert.AreEqual(value1, value2, "Copies should be the same.");
         value2 = ((DateTime)value2).AddHours(2);
         Assert.IsFalse(value1 == value2, "value2 was changed, value1 should not have changed also.");
      }

   }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#583c5120]]
DateTimeTypeFixture 
12[[#583c5120]]
DateTime2TypeFixture 
21[[#583c50c0]]
DateTime 
22[[#583c50c0]]
DateTime2