Esempio n. 1
0
        void OnNextPage2Click(object sender, EventArgs e1, VolumeLocation vlp)
        {
            FireCryptVolume fcv = vlp.FinalVolume;

            this.FinalVolume = fcv;
            this.Close();
        }
Esempio n. 2
0
        void OnNextPage1Click(object sender, EventArgs e1, WelcomePage wp)
        {
            VolumeName = wp.VolumeName;
            Password   = wp.Password;
            VolumeLocation vlp = new VolumeLocation(VolumeName, Password);

            ShowContent(vlp);
            panel1.Controls.Find("finishBtn", true)[0].Click += (s, e) => OnNextPage2Click(sender, e1, vlp);
        }
 public void Verify_Add_Should_AddTheEntityToTheContext()
 {
     // Arrange
     Mock<IDbSet<VolumeLocation>> mockSetVolumeLocations;
     var mockContext = VolumeLocationsMockingSetup.DoMockingSetupForContext(false, out mockSetVolumeLocations);
     var repository = new VolumeLocationsRepository(mockContext.Object);
     var volumeLocations = new VolumeLocation { Active = true, CustomKey = "SALVATORE-RAA", };
     // Act
     repository.Add(volumeLocations);
     // Assert
     mockSetVolumeLocations.Verify(x => x.Add(volumeLocations), Times.Once);
 }
        public void Verify_Add_Should_AddTheEntityToTheContext()
        {
            // Arrange
            Mock <IDbSet <VolumeLocation> > mockSetVolumeLocations;
            var mockContext     = VolumeLocationsMockingSetup.DoMockingSetupForContext(false, out mockSetVolumeLocations);
            var repository      = new VolumeLocationsRepository(mockContext.Object);
            var volumeLocations = new VolumeLocation {
                Active = true, CustomKey = "SALVATORE-RAA",
            };

            // Act
            repository.Add(volumeLocations);
            // Assert
            mockSetVolumeLocations.Verify(x => x.Add(volumeLocations), Times.Once);
        }
Esempio n. 5
0
 void NewVolumeWizardLoad(object sender, EventArgs e1)
 {
     if (!existingVolume)
     {
         WelcomePage wp = new WelcomePage();
         ShowContent(wp);
         panel1.Controls.Find("nextBtn", true)[0].Click += (s, e) => OnNextPage1Click(sender, e1, wp);
     }
     else
     {
         VolumeLocation vlp = new VolumeLocation(VolumeName, Password);
         ShowContent(vlp);
         panel1.Controls.Find("finishBtn", true)[0].Click += (s, e) => OnNextPage2Click(sender, e1, vlp);
     }
 }
Esempio n. 6
0
        public void Verify_MapToEntity_WithExistingEntity_AssignsVolumeLocationProperties()
        {
            // Arrange
            var mapper = new VolumeLocationMapper();
            var model  = VolumeLocationsMockingSetup.DoMockingSetupForVolumeLocationModel();
            // Act
            IVolumeLocation existingEntity = new VolumeLocation {
                Id = 1
            };

            mapper.MapToEntity(model.Object, ref existingEntity);
            // Assert
            // <None>
            // Related Objects
            Assert.Equal(model.Object.VolumeId, existingEntity.VolumeId);
            Assert.Equal(model.Object.LocationId, existingEntity.LocationId);
            // Associated Objects
            // <None>
        }
 public void Verify_MapToEntity_WithExistingEntity_AssignsVolumeLocationProperties()
 {
     // Arrange
     var mapper = new VolumeLocationMapper();
     var model = VolumeLocationsMockingSetup.DoMockingSetupForVolumeLocationModel();
     // Act
     IVolumeLocation existingEntity = new VolumeLocation { Id = 1 };
     mapper.MapToEntity(model.Object, ref existingEntity);
     // Assert
     // <None>
     // Related Objects
     Assert.Equal(model.Object.VolumeId, existingEntity.VolumeId);
     Assert.Equal(model.Object.LocationId, existingEntity.LocationId);
     // Associated Objects
     // <None>
 }