@hashgraph/solo
Version:
An opinionated CLI tool to deploy and manage private Hedera Networks.
41 lines • 1.82 kB
JavaScript
// SPDX-License-Identifier: Apache-2.0
import { expect } from 'chai';
import { StringFacade } from '../../../../../src/business/runtime-state/facade/string-facade.js';
describe('StringFacade', () => {
it('should create a StringFacade instance', () => {
const string_ = 'Hello, world!';
const facade = new StringFacade(string_);
expect(facade.encapsulatedObject).to.equal(string_);
});
it('should compare two StringFacade instances', () => {
const string1 = 'Hello, world!';
const string2 = 'Hello, world!';
const facade1 = new StringFacade(string1);
const facade2 = new StringFacade(string2);
expect(facade1.equals(facade2)).to.equal(true);
});
it('should not compare different StringFacade instances', () => {
const string1 = 'Hello, world!';
const string2 = 'Goodbye, world!';
const facade1 = new StringFacade(string1);
const facade2 = new StringFacade(string2);
expect(facade1.equals(facade2)).to.equal(false);
});
it('should return the string representation of the backing object', () => {
const string_ = 'Hello, world!';
const facade = new StringFacade(string_);
expect(facade.toString()).to.equal(string_);
});
it('should return false when comparing with null', () => {
const string_ = 'Hello, world!';
const facade = new StringFacade(string_);
// eslint-disable-next-line unicorn/no-null
expect(facade.equals(null)).to.equal(false);
});
it('should return true if the same instance is compared', () => {
const string_ = 'Hello, world!';
const facade = new StringFacade(string_);
expect(facade.equals(facade)).to.equal(true);
});
});
//# sourceMappingURL=string-facade.test.js.map