Esempio n. 1
0
        internal void PropertyDelete()
        {
            PropertiesController pc   = new PropertiesController();
            PropertiesInfo       prop = pc.GetProperty(Convert.ToInt32(Params["propertyid"]), PortalId);

            if (prop != null)
            {
                pc.DeleteProperty(PortalId, Convert.ToInt32(Params["propertyid"]));
                if (!(pc.ListProperties(PortalId, prop.ObjectType, prop.ObjectOwnerId).Count > 0))
                {
                    ForumController fc = new ForumController();
                    Forum           fi = fc.GetForum(PortalId, ModuleId, prop.ObjectOwnerId, true);
                    fi.HasProperties = false;
                    fc.Forums_Save(PortalId, fi, false, false);
                }
            }
        }
        public async Task ListsProperties(int propertyCount)
        {
            // Arrange
            IEnumerable <PropertyModel> seededProperties = StubProperties().Generate(propertyCount);

            _listPropertiesUseCaseMock.Setup(m => m.ExecuteAsync(It.IsAny <PropertySearchModel>())).ReturnsAsync(seededProperties);

            // Act
            var result = await _classUnderTest.ListProperties(null, null, null);

            var propertyResults = GetResultData <List <PropertyListItem> >(result);
            var statusCode      = GetStatusCode(result);

            // Assert
            statusCode.Should().Be(200);
            propertyResults.Should().HaveCount(propertyCount);
        }
Esempio n. 3
0
		internal void PropertyDelete()
		{
			PropertiesController pc = new PropertiesController();
			PropertiesInfo prop = pc.GetProperty(Convert.ToInt32(Params["propertyid"]), PortalId);
			if (prop != null)
			{
				pc.DeleteProperty(PortalId, Convert.ToInt32(Params["propertyid"]));
				if (! (pc.ListProperties(PortalId, prop.ObjectType, prop.ObjectOwnerId).Count > 0))
				{
					ForumController fc = new ForumController();
					Forum fi = fc.GetForum(PortalId, ModuleId, prop.ObjectOwnerId, true);
					fi.HasProperties = false;
					fc.Forums_Save(PortalId, fi, false, false);
				}
			}


		}