public void PrimaryObject_Id()
        {
            // This test verifies the Id auto-property works.
            // Note: this test is useless except for code coverage since we are testing that an auto-property works.
            Guid value         = Guid.NewGuid();
            var  primaryObject = new PrimaryObject(value);

            Assert.AreEqual(value, primaryObject.Id);
        }
Beispiel #2
0
        public void SecondaryObject_PrimaryObject()
        {
            // This test verifies the PrimaryObject auto-property works.
            // Note: this test is useless except for code coverage since we are testing that an auto-property works.
            PrimaryObject value           = new PrimaryObject();
            var           secondaryObject = new SecondaryObject();

            secondaryObject.PrimaryObject = value;
            Assert.AreEqual(value, secondaryObject.PrimaryObject);
        }
        public void PrimaryObject_SecondaryObjects()
        {
            // This test verifies the SecondaryObjects auto-property works.
            // Note: this test is useless except for code coverage since we are testing that an auto-property works.
            ICollection <SecondaryObject> value = new Collection <SecondaryObject>();
            var primaryObject = new PrimaryObject(Guid.NewGuid());

            primaryObject.SecondaryObjects = value;
            Assert.AreEqual(value, primaryObject.SecondaryObjects);
        }
        public void PrimaryObject_Name()
        {
            // This test verifies the Name auto-property works.
            // Note: this test is useless except for code coverage since we are testing that an auto-property works.
            string value         = "test";
            var    primaryObject = new PrimaryObject(Guid.NewGuid());

            primaryObject.Name = value;
            Assert.AreEqual(value, primaryObject.Name);
        }
Beispiel #5
0
        public void PrimaryObject_SecondaryObjects()
        {
            // This test verifies the SecondaryObjects auto-property works.
            // Note: this test is useless except for code coverage since we are testing that an auto-property works.
            IEnumerable <SecondaryObject> value = new SecondaryObject[0];
            var primaryObject = new PrimaryObject();

            primaryObject.SecondaryObjects = value;
            Assert.AreEqual(value, primaryObject.SecondaryObjects);
        }
Beispiel #6
0
        public void PrimaryObject_Description()
        {
            // This test verifies the Description auto-property works.
            // Note: this test is useless except for code coverage since we are testing that an auto-property works.
            string value         = "test";
            var    primaryObject = new PrimaryObject();

            primaryObject.Description = value;
            Assert.AreEqual(value, primaryObject.Description);
        }
Beispiel #7
0
        protected override SecondaryObject ContstructModel(Guid id)
        {
            var primaryObjectId = Guid.NewGuid();
            var primaryObject   = new PrimaryObject(primaryObjectId)
            {
                Name             = $"Name {id}",
                Description      = $"Description {id}",
                SecondaryObjects = new List <SecondaryObject>()
                {
                    new SecondaryObject(id),
                },
            };

            foreach (var secondaryObject in primaryObject.SecondaryObjects)
            {
                secondaryObject.Name             = $"Name {secondaryObject.Id}";
                secondaryObject.Description      = $"Description {secondaryObject.Id}";
                secondaryObject.PrimaryObject    = primaryObject;
                secondaryObject.PrimaryObject_Id = primaryObject.Id;
            }

            return(primaryObject.SecondaryObjects.Single());
        }
 public void PrimaryObject_Constructor_Valid()
 {
     // This test verifies that the object can be constructed successfully
     var primaryObject = new PrimaryObject(Guid.NewGuid());
 }
 public void PrimaryObject_Constructor_Id_Empty()
 {
     // This test verifies that the object's constructor will not accept null dependencies
     var primaryObject = new PrimaryObject(Guid.Empty);
 }
Beispiel #10
0
 public void PrimaryObject_Constructor()
 {
     // This test verifies that the default constructor works.
     // Note: this test is useless except for code coverage since we are testing the default constructor with no custom logic.
     var primaryObject = new PrimaryObject();
 }