コード例 #1
0
        public void Clone_WhenInstanceCloned_ThenInstancesAreEqual()
        {
            // arrange
            GPSBuilder builder = GPSBuilder.Create()
                                 .WithAltitude(100)
                                 .WithLatitude(123.3m)
                                 .WithLongitude(180.11m);

            GPS instance0 = builder.Build();

            object instance1 = instance0.Clone();

            // act
            bool result = Equals(instance0, instance1);

            // assert
            Assert.That(instance0, Is.Not.Null);
            Assert.That(instance1, Is.Not.Null);
            Assert.That(instance1, Is.InstanceOf <GPS>());
            Assert.That(ReferenceEquals(instance0, instance1), Is.Not.True);
            Assert.That(result, Is.True);
        }