public void CanCreateFormViewModel() { // Establish Context var viewModelToExpect = new RoleFormViewModel(); // Act RoleFormViewModel viewModelRetrieved = roleManagementService.CreateFormViewModel(); // Assert viewModelRetrieved.ShouldNotBeNull(); viewModelRetrieved.Role.ShouldBeNull(); }
public void CanCreateFormViewModelForRole() { // Establish Context var viewModelToExpect = new RoleFormViewModel(); Role role = RoleInstanceFactory.CreateValidTransientRole(); roleRepository.Expect(r => r.Get(1)) .Return(role); // Act RoleFormViewModel viewModelRetrieved = roleManagementService.CreateFormViewModelFor(1); // Assert viewModelRetrieved.ShouldNotBeNull(); viewModelRetrieved.Role.ShouldNotBeNull(); viewModelRetrieved.Role.ShouldEqual(role); }