blob: a0740eb4f6d7204f5949f4de2b8a9d1ea9ff1d6a [file] [log] [blame]
/*
* Copyright 2016-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.nemo.model.common;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Unit tests for {@link PropertyName}.
*/
public class PropertyNameTest {
private static final String NAME = "SomeName";
private static final String OTHER = "OtherName";
private PropertyName name;
private PropertyName copy;
private PropertyName diff;
@Test
public void fromString() {
name = new PropertyName(NAME);
assertEquals("name not set", NAME, name.getValue());
}
@Test
public void copyConstructor() {
name = new PropertyName(NAME);
copy = new PropertyName(name);
new EqualsTester()
.addEqualityGroup(name, copy)
.testEquals();
}
@Test
public void equality() {
name = new PropertyName(NAME);
copy = new PropertyName(NAME);
diff = new PropertyName(OTHER);
new EqualsTester()
.addEqualityGroup(name, copy)
.addEqualityGroup(diff)
.testEquals();
}
}